You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@apache.org> on 2008/04/23 13:39:21 UTC

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

This looks really good, do you have plans to extend it further like with
adding clients or other extension types?

   ...ant

On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:

>    Page Edited : TUSCANY<http://cwiki.apache.org/confluence/display/TUSCANY>: Build
> your first Web Services with Tuscany<http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany>
>
> Build your first Web Services with Tuscany<http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany>has been edited by Luciano
> Resende<ht...@apache.org> (Apr
> 22, 2008).
>
> (View changes)<http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6>
> Content:
> Build your first Web Services with Tuscany
>
> This guide will give you step by step instructions on how to build your
> first web services.
> The first part, we will learn how we can add the Tuscany Runtime to
> Eclipse IDE.
> The second part, will show how easy is to create a webservices using
> Apache Tuscany.
> Install Tuscany Eclipse Plugins 1.1
> Install the Tuscany Eclipse Plugin
>
> The first thing you do is to start Eclipse and go to *Help -> Software
> Updates -> Find and Install*,
> select "Search for new features to install" and then click next
>
> On the next dialog, click on *"New Remote Site..."* to create a new site
> entry. Give it a name such as
> "Tuscany" and add the site URL as *
> http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>
> Make sure the *"Remote  Site"* that was just created is selected, and
> click *"Finish"*
>
> Select the *"Apache Tuscany SCA Tools"* and click *"Next"*, and then, on
> the next dialog, click *"Finish"*
>
> Accept the *"Plugin License"*
>
> and next click on *"Install All"*
>
> When asked to *"restart eclipse"*, click the  *"yes"* button.
>
> Create your Service Business Logic Create a Java Project
>
> In this step you create a Java Project in Eclipse to hold the composite
> service application.
> Click on the *New Java Project* button   in the toolbar to launch the
> project creation dialog.
> Next you enter "ws" as the *Project name*, and for *Project Layout* select
> *Create separate*
> *folders for sources and class files.*
>
>
>
>
> Hit the *Next* button, and on the following page go to the *Libraries*tab. Use the
> *Add Library...*
> button on the right to add the *Tuscany Library* library to the project.
>
>
>
>
> Hit the *Finish* button to complete the *New Java Project* dialog to
> create the "ws" java project.
>
>
>
>
> Construct Services
>
> First you create the "helloworld" package folders into which later in this
> step you place service implementations.
> Select the "ws" project and click on the *New Java Package* button in the
> toolbar to launch
> the package creation dialog.
>
> Next you enter "helloworld" as the package *Name*, and press the *Finish*button to complete the
> dialog.
>
>
> *HelloWorld*
>
> In this step you create the HelloWorld service interface and
> implementation.
> Select the "helloworld" package. Next you click on the dropdown arrow next
> to the *New Java Class*
> button    and select the *New Java Interface*    option from the dropdown
> list. In the dialog
> enter "HelloWorld" as the *Name* of the interface and select the Finish
> button to complete the dialog.
> The Java editor will open on the new created Java interface. Replace the
> content of the editor by
> *copy-paste* of the following Java interface code snippet.
>
> package helloworld;import org.osoa.sca.annotations.Remotable;
> @Remotablepublic interface HelloWorld {
>     String sayHello(String name);
> }
>
>  Select the "helloworld" package again. Select the *New Java Class* button
> . In the dialog enter
> "HelloWorldImpl" as the *Name* of the class, add "Catalog" as the
> interface this class implements, and
> then select *Finish* to complete the dialog.
>
> The Java editor will open on the new created Java class. Replace the
> content of the editor by
> *copy-paste* of the following Java class code snippet.
>
> package helloworld;public class HelloWorldImpl implements HelloWorld {
> 	public String sayHello(String name) {
> 		return "Hello " + name;
> 	}
> }
>
>  After completing these steps the content of the "ws" project will look as
> follows.
>
>
> Compose Services
>
> Now that you have all the required service implementations you compose
> them together to provide
> the store composite service. The composition is stored in a .composite
> file.
>
> Select the "src" folder of the "ws" project. *Right click* to get the
> context menu, select *New*, and
> then *File*. In the *New File* dialog enter "helloworld.composite" for the
> *File name*, and then select *Finish*
> to complete the dialog.
>
> The Text editor will open on the new created composite file. Replace the
> content of the editor by
> *copy-paste* of the following composite snippet.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <composite	xmlns="http://www.osoa.org/xmlns/sca/1.0"			xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"			xmlns:c="http://helloworld"			name="helloworld">
>
>
> 	<component name="HelloWorldComponent">
> 		<implementation.java class="helloworld.HelloWorldImpl"/>
> 		<service name="HelloWorld">
> 			<binding.ws uri="http://localhost:8080/HelloWorld"/>		</service>
> 	</component>
> </composite>
>
>  After completing these steps the content of the "store" project will look
> as follows.
>
>
>
>
> Congratulations you completed your 1st composite service applications, now
> its time to take it into
> action.
> Use Services
>
> In this step you launch and use the ws composite service application you
> created.
>
> First select the "helloworld.composite" file, in your "ws" project. *Right
> click* to get the
> context menu, select *Run As*, and then *Tuscany*. The Tuscany runtime
> will start up adding
> the helloworld composition to its domain and will make the helloworld web
> service live.
>
> The Eclipse console will show the following messages.
>
>
>
>  Next Launch your Web browser and enter the following address:
>
> http://localhost:8080/HelloWorld?wsdl
>
> You should now have your web service live, and the url should give you
> back a generated wsdl for the service.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://helloworld" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="http://helloworld" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
>     <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns:ns="http://helloworld">         <xs:element name="sayHello">
>             <xs:complexType>
>                <xs:sequence>
>                   <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/>
>                </xs:sequence>
>             </xs:complexType>
>
>          </xs:element>
>          <xs:element name="sayHelloResponse">
>             <xs:complexType>
>                <xs:sequence>
>                   <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
>                </xs:sequence>
>             </xs:complexType>
>          </xs:element>
>       </xs:schema>
>
>   </wsdl:types>
>   <wsdl:message name="sayHelloRequest">
>     <wsdl:part name="parameters" element="ns0:sayHello">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:message name="sayHelloResponse">
>     <wsdl:part name="parameters" element="ns0:sayHelloResponse">
>     </wsdl:part>
>   </wsdl:message>
>
>   <wsdl:portType name="HelloWorldPortType">
>     <wsdl:operation name="sayHello">
>       <wsdl:input message="ns0:sayHelloRequest" wsaw:Action="urn:sayHello">
>     </wsdl:input>
>       <wsdl:output message="ns0:sayHelloResponse" wsaw:Action="urn:sayHelloResponse">
>     </wsdl:output>
>     </wsdl:operation>
>   </wsdl:portType>
>   <wsdl:binding name="HelloWorldHttpBinding" type="ns0:HelloWorldPortType">
>
>     <http:binding verb="POST"/>
>     <wsdl:operation name="sayHello">
>       <http:operation location="HelloWorld/sayHello"/>
>       <wsdl:input>
>         <mime:content part="sayHello" type="text/xml"/>
>       </wsdl:input>
>       <wsdl:output>
>         <mime:content part="sayHello" type="text/xml"/>
>       </wsdl:output>
>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:binding name="HelloWorldSOAP11Binding" type="ns0:HelloWorldPortType">
>     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation name="sayHello">
>       <soap:operation soapAction="urn:sayHello" style="document"/>
>       <wsdl:input>
>         <soap:body use="literal"/>
>       </wsdl:input>
>
>       <wsdl:output>
>         <soap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="HelloWorld">
>     <wsdl:port name="HelloWorldSOAP11port_http" binding="ns0:HelloWorldSOAP11Binding">
>       <soap:address location="http://192.168.209.1:8080/HelloWorld"/>    </wsdl:port>
>
>     <wsdl:port name="HelloWorldHttpport" binding="ns0:HelloWorldHttpBinding">
>       <http:address location="http://192.168.209.1:8080/HelloWorld"/>    </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
>
>      Powered by Atlassian Confluence<http://www.atlassian.com/software/confluence/default.jsp?clicked=footer>(Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
> request <http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470>
>
> Unsubscribe or edit your notifications preferences<http://cwiki.apache.org/confluence/users/viewnotifications.action>
>

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by Luciano Resende <lu...@gmail.com>.
Sorry for delayed response, I had a chance to upgrade to the 1.2
plugin and run this sucessfully.
Have you added the proper Tuscany Library to your project ?

On Mon, Apr 28, 2008 at 2:27 AM, ant elder <an...@gmail.com> wrote:
> Still not got this to work with the 1.2 release plugin. Looking at the code
> I wondered if we should have two run options - "Run As - Tuscany standalone"
> and "Run As - Tuscany distributed"? The standalone one would use the regular
> SCADomain from the host-embedded module like most of the tests and samples
> use.
>
>   ...ant
>
> On Fri, Apr 25, 2008 at 2:09 PM, ant elder <an...@gmail.com> wrote:
>
>> Have you got that example working with the eclipse plugin from the 1.2 RC4
>> release? I've tried but it crashes with the exception below. It also starts
>> up all sorts of endpoints, i guess for the workspace stuff, is there any way
>> to prevent that?
>>
>>    ...ant
>>
>> Caused by: javax.xml.stream.XMLStreamException: Non-default namespace can
>> not map to empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
>>     at
>> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
>>     at
>> com.ctc.wstx.sw.BaseNsStreamWriter.setPrefix(BaseNsStreamWriter.java:210)
>>     at
>> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writeQNamePrefix(BaseStAXArtifactProcessor.java:414)
>>     at
>> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writePrefix(BaseStAXArtifactProcessor.java:493)
>>     at
>> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeAttributePrefixes(BaseStAXArtifactProcessor.java:302)
>>     at
>> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeStart(BaseStAXArtifactProcessor.java:220)
>>     at
>> org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.writeStart(BaseAssemblyProcessor.java:137)
>>     at
>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.write(CompositeProcessor.java:504)
>>     at
>> org.apache.tuscany.sca.workspace.admin.impl.DeployedCompositeCollectionImpl.writeCompositeCollection(DeployedCompositeCollectionImpl.java:382)
>>
>>
>> On Thu, Apr 24, 2008 at 3:20 PM, Luciano Resende <lu...@gmail.com>
>> wrote:
>>
>> > Totally +1, What I had in mind was to keep it simple and usable by
>> > someone that does not know much of SCA. What if we create a "First
>> > Steps" series of articles ?
>> >
>> > On Thu, Apr 24, 2008 at 2:14 AM, ant elder <an...@gmail.com> wrote:
>> > > I asked as I'd like to help expand it but don't want to step on your
>> > toes.
>> > >  Adding web clients sounds good, expanding the WS bit with how to use
>> > other
>> > >  databindings would be useful, maybe something on other bindings like
>> > JMS,
>> > >  then it could go on with what to do when you want to run it out side
>> > of
>> > >  eclipse - how to make contribution jars or run standalone or in
>> > webapps etc.
>> > >  I like that that page is nice and simple and clear and focused so it
>> > would
>> > >  be good to try to maintain that, maybe have separate pages for each
>> > topic
>> > >  but linked together and in the same sort of style as that one. WDYT?
>> > >
>> > >    ...ant
>> > >
>> > >  On Wed, Apr 23, 2008 at 5:17 PM, Luciano Resende <
>> > luckbr1975@gmail.com>
>> > >  wrote:
>> > >
>> > >
>> > >
>> > >  > Yes, it's on my todo list for the next couple days...
>> > >  >
>> > >  > Do you have any ideas for what type of extensions to use ? Maybe
>> > >  > JSON-RPC and use a quick web2.0 client app to consume the service ?
>> > >  >
>> > >  > On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org>
>> > wrote:
>> > >  > > This looks really good, do you have plans to extend it further
>> > like with
>> > >  > >  adding clients or other extension types?
>> > >  > >
>> > >  > >    ...ant
>> > >  > >
>> > >  > >  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
>> > >  > >
>> > >  > >  >    Page Edited : TUSCANY<
>> > >  > http://cwiki.apache.org/confluence/display/TUSCANY>: Build
>> > >  > >  > your first Web Services with Tuscany<
>> > >  >
>> > http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
>> > >  > >
>> > >  > >  >
>> > >  > >  > Build your first Web Services with Tuscany<
>> > >  >
>> > http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
>> > >has
>> > >  > been edited by Luciano
>> > >  > >  > Resende<
>> > >  > http://cwiki.apache.org/confluence/display/%7Elresende@apache.org>
>> > (Apr
>> > >  > >  > 22, 2008).
>> > >  > >  >
>> > >  > >  > (View changes)<
>> > >  >
>> > http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6
>> > >  > >
>> > >  > >  > Content:
>> > >  > >
>> > >  > > > Build your first Web Services with Tuscany
>> > >  > >  >
>> > >  > >  > This guide will give you step by step instructions on how to
>> > build
>> > >  > your
>> > >  > >  > first web services.
>> > >  > >  > The first part, we will learn how we can add the Tuscany
>> > Runtime to
>> > >  > >  > Eclipse IDE.
>> > >  > >  > The second part, will show how easy is to create a webservices
>> > using
>> > >  > >  > Apache Tuscany.
>> > >  > >
>> > >  > > > Install Tuscany Eclipse Plugins 1.1
>> > >  > >  > Install the Tuscany Eclipse Plugin
>> > >  > >  >
>> > >  > >  > The first thing you do is to start Eclipse and go to *Help ->
>> > >  > Software
>> > >  > >  > Updates -> Find and Install*,
>> > >  > >  > select "Search for new features to install" and then click
>> > next
>> > >  > >  >
>> > >  > >  > On the next dialog, click on *"New Remote Site..."* to create
>> > a new
>> > >  > site
>> > >  > >  > entry. Give it a name such as
>> > >  > >  > "Tuscany" and add the site URL as *
>> > >  > >  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>> > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>> > >  > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>> > >  > >  >
>> > >  > >  > Make sure the *"Remote  Site"* that was just created is
>> > selected, and
>> > >  > >  > click *"Finish"*
>> > >  > >  >
>> > >  > >  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*,
>> > and then,
>> > >  > on
>> > >  > >  > the next dialog, click *"Finish"*
>> > >  > >  >
>> > >  > >  > Accept the *"Plugin License"*
>> > >  > >  >
>> > >  > >  > and next click on *"Install All"*
>> > >  > >  >
>> > >  > >  > When asked to *"restart eclipse"*, click the  *"yes"* button.
>> > >  > >  >
>> > >  > >  > Create your Service Business Logic Create a Java Project
>> > >  > >
>> > >  > > >
>> > >  > >  > In this step you create a Java Project in Eclipse to hold the
>> > >  > composite
>> > >  > >  > service application.
>> > >  > >  > Click on the *New Java Project* button   in the toolbar to
>> > launch the
>> > >  > >
>> > >  > > > project creation dialog.
>> > >  > >  > Next you enter "ws" as the *Project name*, and for *Project
>> > Layout*
>> > >  > select
>> > >  > >  > *Create separate*
>> > >  > >  > *folders for sources and class files.*
>> > >  > >
>> > >  > > >
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >  > Hit the *Next* button, and on the following page go to the
>> > >  > *Libraries*tab. Use the
>> > >  > >  > *Add Library...*
>> > >  > >  > button on the right to add the *Tuscany Library* library to
>> > the
>> > >  > project.
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >
>> > >  > > > Hit the *Finish* button to complete the *New Java Project*
>> > dialog to
>> > >  > >  > create the "ws" java project.
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >
>> > >  > > > Construct Services
>> > >  > >  >
>> > >  > >  > First you create the "helloworld" package folders into which
>> > later in
>> > >  > this
>> > >  > >  > step you place service implementations.
>> > >  > >  > Select the "ws" project and click on the *New Java Package*
>> > button in
>> > >  > the
>> > >  > >
>> > >  > > > toolbar to launch
>> > >  > >  > the package creation dialog.
>> > >  > >  >
>> > >  > >  > Next you enter "helloworld" as the package *Name*, and press
>> > the
>> > >  > *Finish*button to complete the
>> > >  > >  > dialog.
>> > >  > >  >
>> > >  > >  >
>> > >  > >
>> > >  > > > *HelloWorld*
>> > >  > >  >
>> > >  > >  > In this step you create the HelloWorld service interface and
>> > >  > >  > implementation.
>> > >  > >  > Select the "helloworld" package. Next you click on the
>> > dropdown arrow
>> > >  > next
>> > >  > >  > to the *New Java Class*
>> > >  > >  > button    and select the *New Java Interface*    option from
>> > the
>> > >  > dropdown
>> > >  > >
>> > >  > > > list. In the dialog
>> > >  > >  > enter "HelloWorld" as the *Name* of the interface and select
>> > the
>> > >  > Finish
>> > >  > >  > button to complete the dialog.
>> > >  > >  > The Java editor will open on the new created Java interface.
>> > Replace
>> > >  > the
>> > >  > >  > content of the editor by
>> > >  > >  > *copy-paste* of the following Java interface code snippet.
>> > >  > >  >
>> > >  > >
>> > >  > > > package helloworld;import org.osoa.sca.annotations.Remotable;
>> > >  > >  > @Remotablepublic interface HelloWorld {
>> > >  > >  >     String sayHello(String name);
>> > >  > >  > }
>> > >  > >  >
>> > >  > >
>> > >  > > >  Select the "helloworld" package again. Select the *New Java
>> > Class*
>> > >  > button
>> > >  > >
>> > >  > > > . In the dialog enter
>> > >  > >  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as
>> > the
>> > >  > >  > interface this class implements, and
>> > >  > >  > then select *Finish* to complete the dialog.
>> > >  > >  >
>> > >  > >  > The Java editor will open on the new created Java class.
>> > Replace the
>> > >  > >  > content of the editor by
>> > >  > >  > *copy-paste* of the following Java class code snippet.
>> > >  > >  >
>> > >  > >
>> > >  > > > package helloworld;public class HelloWorldImpl implements
>> > HelloWorld {
>> > >  > >  >       public String sayHello(String name) {
>> > >  > >  >               return "Hello " + name;
>> > >  > >  >       }
>> > >  > >  > }
>> > >  > >  >
>> > >  > >
>> > >  > > >  After completing these steps the content of the "ws" project
>> > will
>> > >  > look as
>> > >  > >  > follows.
>> > >  > >  >
>> > >  > >  >
>> > >  > >
>> > >  > > > Compose Services
>> > >  > >  >
>> > >  > >  > Now that you have all the required service implementations you
>> > >  > compose
>> > >  > >  > them together to provide
>> > >  > >  > the store composite service. The composition is stored in a
>> > >  > .composite
>> > >  > >  > file.
>> > >  > >  >
>> > >  > >  > Select the "src" folder of the "ws" project. *Right click* to
>> > get the
>> > >  > >  > context menu, select *New*, and
>> > >  > >  > then *File*. In the *New File* dialog enter
>> > "helloworld.composite"
>> > >  > for the
>> > >  > >  > *File name*, and then select *Finish*
>> > >  > >  > to complete the dialog.
>> > >  > >  >
>> > >  > >  > The Text editor will open on the new created composite file.
>> > Replace
>> > >  > the
>> > >  > >  > content of the editor by
>> > >  > >  > *copy-paste* of the following composite snippet.
>> > >  > >  >
>> > >  > >
>> > >  > > > <?xml version="1.0" encoding="UTF-8"?>
>> > >  > >  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"
>> > >  >         xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>> > >  >       xmlns:c="http://helloworld"
>> > name="helloworld">
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >       <component name="HelloWorldComponent">
>> > >  > >  >               <implementation.java
>> > >  > class="helloworld.HelloWorldImpl"/>
>> > >  > >  >               <service name="HelloWorld">
>> > >  > >  >                       <binding.ws uri="
>> > >  > http://localhost:8080/HelloWorld"/>            </service>
>> > >  > >  >       </component>
>> > >  > >  > </composite>
>> > >  > >  >
>> > >  > >
>> > >  > > >  After completing these steps the content of the "store"
>> > project will
>> > >  > look
>> > >  > >  > as follows.
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >
>> > >  > > > Congratulations you completed your 1st composite service
>> > applications,
>> > >  > now
>> > >  > >  > its time to take it into
>> > >  > >  > action.
>> > >  > >
>> > >  > > > Use Services
>> > >  > >  >
>> > >  > >  > In this step you launch and use the ws composite service
>> > application
>> > >  > you
>> > >  > >  > created.
>> > >  > >  >
>> > >  > >  > First select the "helloworld.composite" file, in your "ws"
>> > project.
>> > >  > *Right
>> > >  > >  > click* to get the
>> > >  > >  > context menu, select *Run As*, and then *Tuscany*. The Tuscany
>> > >  > runtime
>> > >  > >  > will start up adding
>> > >  > >  > the helloworld composition to its domain and will make the
>> > helloworld
>> > >  > web
>> > >  > >  > service live.
>> > >  > >  >
>> > >  > >  > The Eclipse console will show the following messages.
>> > >  > >  >
>> > >  > >  >
>> > >  > >  >
>> > >  > >
>> > >  > > >  Next Launch your Web browser and enter the following address:
>> > >  > >  >
>> > >  > >  > http://localhost:8080/HelloWorld?wsdl
>> > >  > >  >
>> > >  > >
>> > >  > > > You should now have your web service live, and the url should
>> > give you
>> > >  > >  > back a generated wsdl for the service.
>> > >  > >  >
>> > >  > >
>> > >  > >
>> > >  > > > <?xml version="1.0" encoding="UTF-8"?>
>> > >  > >  > <wsdl:definitions targetNamespace="http://helloworld"
>> > xmlns:soap12="
>> > >  > http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="
>> > http://helloworld"
>> > >  > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
>> > >  > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
>> > >  > http://org.apache.axis2/xsd" xmlns:wsaw="
>> > >  > http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="
>> > >  > http://www.w3.org/2001/XMLSchema" xmlns:soap="
>> > >  > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
>> > >  > http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
>> > >  > >  >     <xs:schema attributeFormDefault="qualified"
>> > >  > elementFormDefault="qualified" targetNamespace="http://helloworld"
>> > >  > xmlns:ns="http://helloworld">         <xs:element name="sayHello">
>> > >  > >  >             <xs:complexType>
>> > >  > >  >                <xs:sequence>
>> > >  > >  >                   <xs:element minOccurs="0" name="param0"
>> > >  > nillable="true" type="xs:string"/>
>> > >  > >  >                </xs:sequence>
>> > >  > >  >             </xs:complexType>
>> > >  > >  >
>> > >  > >  >          </xs:element>
>> > >  > >  >          <xs:element name="sayHelloResponse">
>> > >  > >  >             <xs:complexType>
>> > >  > >  >                <xs:sequence>
>> > >  > >  >                   <xs:element minOccurs="0" name="return"
>> > >  > nillable="true" type="xs:string"/>
>> > >  > >  >                </xs:sequence>
>> > >  > >  >             </xs:complexType>
>> > >  > >  >          </xs:element>
>> > >  > >  >       </xs:schema>
>> > >  > >  >
>> > >  > >  >   </wsdl:types>
>> > >  > >  >   <wsdl:message name="sayHelloRequest">
>> > >  > >  >     <wsdl:part name="parameters" element="ns0:sayHello">
>> > >  > >  >     </wsdl:part>
>> > >  > >  >   </wsdl:message>
>> > >  > >  >   <wsdl:message name="sayHelloResponse">
>> > >  > >  >     <wsdl:part name="parameters"
>> > element="ns0:sayHelloResponse">
>> > >  > >  >     </wsdl:part>
>> > >  > >  >   </wsdl:message>
>> > >  > >  >
>> > >  > >  >   <wsdl:portType name="HelloWorldPortType">
>> > >  > >  >     <wsdl:operation name="sayHello">
>> > >  > >  >       <wsdl:input message="ns0:sayHelloRequest"
>> > >  > wsaw:Action="urn:sayHello">
>> > >  > >  >     </wsdl:input>
>> > >  > >  >       <wsdl:output message="ns0:sayHelloResponse"
>> > >  > wsaw:Action="urn:sayHelloResponse">
>> > >  > >  >     </wsdl:output>
>> > >  > >  >     </wsdl:operation>
>> > >  > >  >   </wsdl:portType>
>> > >  > >  >   <wsdl:binding name="HelloWorldHttpBinding"
>> > >  > type="ns0:HelloWorldPortType">
>> > >  > >  >
>> > >  > >  >     <http:binding verb="POST"/>
>> > >  > >  >     <wsdl:operation name="sayHello">
>> > >  > >  >       <http:operation location="HelloWorld/sayHello"/>
>> > >  > >  >       <wsdl:input>
>> > >  > >  >         <mime:content part="sayHello" type="text/xml"/>
>> > >  > >  >       </wsdl:input>
>> > >  > >  >       <wsdl:output>
>> > >  > >  >         <mime:content part="sayHello" type="text/xml"/>
>> > >  > >  >       </wsdl:output>
>> > >  > >  >
>> > >  > >  >     </wsdl:operation>
>> > >  > >  >   </wsdl:binding>
>> > >  > >  >   <wsdl:binding name="HelloWorldSOAP11Binding"
>> > >  > type="ns0:HelloWorldPortType">
>> > >  > >  >     <soap:binding style="document" transport="
>> > >  > http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation
>> > >  > name="sayHello">
>> > >  > >  >       <soap:operation soapAction="urn:sayHello"
>> > style="document"/>
>> > >  > >  >       <wsdl:input>
>> > >  > >  >         <soap:body use="literal"/>
>> > >  > >  >       </wsdl:input>
>> > >  > >  >
>> > >  > >  >       <wsdl:output>
>> > >  > >  >         <soap:body use="literal"/>
>> > >  > >  >       </wsdl:output>
>> > >  > >  >     </wsdl:operation>
>> > >  > >  >   </wsdl:binding>
>> > >  > >  >   <wsdl:service name="HelloWorld">
>> > >  > >  >     <wsdl:port name="HelloWorldSOAP11port_http"
>> > >  > binding="ns0:HelloWorldSOAP11Binding">
>> > >  > >  >       <soap:address location="
>> > http://192.168.209.1:8080/HelloWorld"/>
>> > >  >    </wsdl:port>
>> > >  > >  >
>> > >  > >  >     <wsdl:port name="HelloWorldHttpport"
>> > >  > binding="ns0:HelloWorldHttpBinding">
>> > >  > >  >       <http:address location="
>> > http://192.168.209.1:8080/HelloWorld"/>
>> > >  >    </wsdl:port>
>> > >  > >  >   </wsdl:service>
>> > >  > >  > </wsdl:definitions>
>> > >  > >  >
>> > >  > >  >      Powered by Atlassian Confluence<
>> > >  >
>> > http://www.atlassian.com/software/confluence/default.jsp?clicked=footer
>> > >(Version:
>> > >  > 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
>> > >  > >  > request <
>> > http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470
>> > >  > >
>> > >  > >
>> > >  > >
>> > >  > > >
>> > >  > >  > Unsubscribe or edit your notifications preferences<
>> > >  > http://cwiki.apache.org/confluence/users/viewnotifications.action>
>> > >  > >  >
>> > >  > >
>> > >  >
>> > >  >
>> > >  >
>> > >  > --
>> > >  > Luciano Resende
>> > >  > Apache Tuscany Committer
>> > >  > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende><
>> > http://people.apache.org/%7Elresende>
>> > >  > http://lresende.blogspot.com/
>> > >  >
>> > >
>> >
>> >
>> >
>> > --
>> > Luciano Resende
>> > Apache Tuscany Committer
>> > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende>
>> > http://lresende.blogspot.com/
>> >
>>
>>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by ant elder <an...@gmail.com>.
Still not got this to work with the 1.2 release plugin. Looking at the code
I wondered if we should have two run options - "Run As - Tuscany standalone"
and "Run As - Tuscany distributed"? The standalone one would use the regular
SCADomain from the host-embedded module like most of the tests and samples
use.

   ...ant

On Fri, Apr 25, 2008 at 2:09 PM, ant elder <an...@gmail.com> wrote:

> Have you got that example working with the eclipse plugin from the 1.2 RC4
> release? I've tried but it crashes with the exception below. It also starts
> up all sorts of endpoints, i guess for the workspace stuff, is there any way
> to prevent that?
>
>    ...ant
>
> Caused by: javax.xml.stream.XMLStreamException: Non-default namespace can
> not map to empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
>     at
> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
>     at
> com.ctc.wstx.sw.BaseNsStreamWriter.setPrefix(BaseNsStreamWriter.java:210)
>     at
> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writeQNamePrefix(BaseStAXArtifactProcessor.java:414)
>     at
> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writePrefix(BaseStAXArtifactProcessor.java:493)
>     at
> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeAttributePrefixes(BaseStAXArtifactProcessor.java:302)
>     at
> org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeStart(BaseStAXArtifactProcessor.java:220)
>     at
> org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.writeStart(BaseAssemblyProcessor.java:137)
>     at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.write(CompositeProcessor.java:504)
>     at
> org.apache.tuscany.sca.workspace.admin.impl.DeployedCompositeCollectionImpl.writeCompositeCollection(DeployedCompositeCollectionImpl.java:382)
>
>
> On Thu, Apr 24, 2008 at 3:20 PM, Luciano Resende <lu...@gmail.com>
> wrote:
>
> > Totally +1, What I had in mind was to keep it simple and usable by
> > someone that does not know much of SCA. What if we create a "First
> > Steps" series of articles ?
> >
> > On Thu, Apr 24, 2008 at 2:14 AM, ant elder <an...@gmail.com> wrote:
> > > I asked as I'd like to help expand it but don't want to step on your
> > toes.
> > >  Adding web clients sounds good, expanding the WS bit with how to use
> > other
> > >  databindings would be useful, maybe something on other bindings like
> > JMS,
> > >  then it could go on with what to do when you want to run it out side
> > of
> > >  eclipse - how to make contribution jars or run standalone or in
> > webapps etc.
> > >  I like that that page is nice and simple and clear and focused so it
> > would
> > >  be good to try to maintain that, maybe have separate pages for each
> > topic
> > >  but linked together and in the same sort of style as that one. WDYT?
> > >
> > >    ...ant
> > >
> > >  On Wed, Apr 23, 2008 at 5:17 PM, Luciano Resende <
> > luckbr1975@gmail.com>
> > >  wrote:
> > >
> > >
> > >
> > >  > Yes, it's on my todo list for the next couple days...
> > >  >
> > >  > Do you have any ideas for what type of extensions to use ? Maybe
> > >  > JSON-RPC and use a quick web2.0 client app to consume the service ?
> > >  >
> > >  > On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org>
> > wrote:
> > >  > > This looks really good, do you have plans to extend it further
> > like with
> > >  > >  adding clients or other extension types?
> > >  > >
> > >  > >    ...ant
> > >  > >
> > >  > >  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
> > >  > >
> > >  > >  >    Page Edited : TUSCANY<
> > >  > http://cwiki.apache.org/confluence/display/TUSCANY>: Build
> > >  > >  > your first Web Services with Tuscany<
> > >  >
> > http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> > >  > >
> > >  > >  >
> > >  > >  > Build your first Web Services with Tuscany<
> > >  >
> > http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> > >has
> > >  > been edited by Luciano
> > >  > >  > Resende<
> > >  > http://cwiki.apache.org/confluence/display/%7Elresende@apache.org>
> > (Apr
> > >  > >  > 22, 2008).
> > >  > >  >
> > >  > >  > (View changes)<
> > >  >
> > http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6
> > >  > >
> > >  > >  > Content:
> > >  > >
> > >  > > > Build your first Web Services with Tuscany
> > >  > >  >
> > >  > >  > This guide will give you step by step instructions on how to
> > build
> > >  > your
> > >  > >  > first web services.
> > >  > >  > The first part, we will learn how we can add the Tuscany
> > Runtime to
> > >  > >  > Eclipse IDE.
> > >  > >  > The second part, will show how easy is to create a webservices
> > using
> > >  > >  > Apache Tuscany.
> > >  > >
> > >  > > > Install Tuscany Eclipse Plugins 1.1
> > >  > >  > Install the Tuscany Eclipse Plugin
> > >  > >  >
> > >  > >  > The first thing you do is to start Eclipse and go to *Help ->
> > >  > Software
> > >  > >  > Updates -> Find and Install*,
> > >  > >  > select "Search for new features to install" and then click
> > next
> > >  > >  >
> > >  > >  > On the next dialog, click on *"New Remote Site..."* to create
> > a new
> > >  > site
> > >  > >  > entry. Give it a name such as
> > >  > >  > "Tuscany" and add the site URL as *
> > >  > >  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> > >  > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> > >  > >  >
> > >  > >  > Make sure the *"Remote  Site"* that was just created is
> > selected, and
> > >  > >  > click *"Finish"*
> > >  > >  >
> > >  > >  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*,
> > and then,
> > >  > on
> > >  > >  > the next dialog, click *"Finish"*
> > >  > >  >
> > >  > >  > Accept the *"Plugin License"*
> > >  > >  >
> > >  > >  > and next click on *"Install All"*
> > >  > >  >
> > >  > >  > When asked to *"restart eclipse"*, click the  *"yes"* button.
> > >  > >  >
> > >  > >  > Create your Service Business Logic Create a Java Project
> > >  > >
> > >  > > >
> > >  > >  > In this step you create a Java Project in Eclipse to hold the
> > >  > composite
> > >  > >  > service application.
> > >  > >  > Click on the *New Java Project* button   in the toolbar to
> > launch the
> > >  > >
> > >  > > > project creation dialog.
> > >  > >  > Next you enter "ws" as the *Project name*, and for *Project
> > Layout*
> > >  > select
> > >  > >  > *Create separate*
> > >  > >  > *folders for sources and class files.*
> > >  > >
> > >  > > >
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >  > Hit the *Next* button, and on the following page go to the
> > >  > *Libraries*tab. Use the
> > >  > >  > *Add Library...*
> > >  > >  > button on the right to add the *Tuscany Library* library to
> > the
> > >  > project.
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >
> > >  > > > Hit the *Finish* button to complete the *New Java Project*
> > dialog to
> > >  > >  > create the "ws" java project.
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >
> > >  > > > Construct Services
> > >  > >  >
> > >  > >  > First you create the "helloworld" package folders into which
> > later in
> > >  > this
> > >  > >  > step you place service implementations.
> > >  > >  > Select the "ws" project and click on the *New Java Package*
> > button in
> > >  > the
> > >  > >
> > >  > > > toolbar to launch
> > >  > >  > the package creation dialog.
> > >  > >  >
> > >  > >  > Next you enter "helloworld" as the package *Name*, and press
> > the
> > >  > *Finish*button to complete the
> > >  > >  > dialog.
> > >  > >  >
> > >  > >  >
> > >  > >
> > >  > > > *HelloWorld*
> > >  > >  >
> > >  > >  > In this step you create the HelloWorld service interface and
> > >  > >  > implementation.
> > >  > >  > Select the "helloworld" package. Next you click on the
> > dropdown arrow
> > >  > next
> > >  > >  > to the *New Java Class*
> > >  > >  > button    and select the *New Java Interface*    option from
> > the
> > >  > dropdown
> > >  > >
> > >  > > > list. In the dialog
> > >  > >  > enter "HelloWorld" as the *Name* of the interface and select
> > the
> > >  > Finish
> > >  > >  > button to complete the dialog.
> > >  > >  > The Java editor will open on the new created Java interface.
> > Replace
> > >  > the
> > >  > >  > content of the editor by
> > >  > >  > *copy-paste* of the following Java interface code snippet.
> > >  > >  >
> > >  > >
> > >  > > > package helloworld;import org.osoa.sca.annotations.Remotable;
> > >  > >  > @Remotablepublic interface HelloWorld {
> > >  > >  >     String sayHello(String name);
> > >  > >  > }
> > >  > >  >
> > >  > >
> > >  > > >  Select the "helloworld" package again. Select the *New Java
> > Class*
> > >  > button
> > >  > >
> > >  > > > . In the dialog enter
> > >  > >  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as
> > the
> > >  > >  > interface this class implements, and
> > >  > >  > then select *Finish* to complete the dialog.
> > >  > >  >
> > >  > >  > The Java editor will open on the new created Java class.
> > Replace the
> > >  > >  > content of the editor by
> > >  > >  > *copy-paste* of the following Java class code snippet.
> > >  > >  >
> > >  > >
> > >  > > > package helloworld;public class HelloWorldImpl implements
> > HelloWorld {
> > >  > >  >       public String sayHello(String name) {
> > >  > >  >               return "Hello " + name;
> > >  > >  >       }
> > >  > >  > }
> > >  > >  >
> > >  > >
> > >  > > >  After completing these steps the content of the "ws" project
> > will
> > >  > look as
> > >  > >  > follows.
> > >  > >  >
> > >  > >  >
> > >  > >
> > >  > > > Compose Services
> > >  > >  >
> > >  > >  > Now that you have all the required service implementations you
> > >  > compose
> > >  > >  > them together to provide
> > >  > >  > the store composite service. The composition is stored in a
> > >  > .composite
> > >  > >  > file.
> > >  > >  >
> > >  > >  > Select the "src" folder of the "ws" project. *Right click* to
> > get the
> > >  > >  > context menu, select *New*, and
> > >  > >  > then *File*. In the *New File* dialog enter
> > "helloworld.composite"
> > >  > for the
> > >  > >  > *File name*, and then select *Finish*
> > >  > >  > to complete the dialog.
> > >  > >  >
> > >  > >  > The Text editor will open on the new created composite file.
> > Replace
> > >  > the
> > >  > >  > content of the editor by
> > >  > >  > *copy-paste* of the following composite snippet.
> > >  > >  >
> > >  > >
> > >  > > > <?xml version="1.0" encoding="UTF-8"?>
> > >  > >  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"
> > >  >         xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
> > >  >       xmlns:c="http://helloworld"
> > name="helloworld">
> > >  > >  >
> > >  > >  >
> > >  > >  >       <component name="HelloWorldComponent">
> > >  > >  >               <implementation.java
> > >  > class="helloworld.HelloWorldImpl"/>
> > >  > >  >               <service name="HelloWorld">
> > >  > >  >                       <binding.ws uri="
> > >  > http://localhost:8080/HelloWorld"/>            </service>
> > >  > >  >       </component>
> > >  > >  > </composite>
> > >  > >  >
> > >  > >
> > >  > > >  After completing these steps the content of the "store"
> > project will
> > >  > look
> > >  > >  > as follows.
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >
> > >  > > > Congratulations you completed your 1st composite service
> > applications,
> > >  > now
> > >  > >  > its time to take it into
> > >  > >  > action.
> > >  > >
> > >  > > > Use Services
> > >  > >  >
> > >  > >  > In this step you launch and use the ws composite service
> > application
> > >  > you
> > >  > >  > created.
> > >  > >  >
> > >  > >  > First select the "helloworld.composite" file, in your "ws"
> > project.
> > >  > *Right
> > >  > >  > click* to get the
> > >  > >  > context menu, select *Run As*, and then *Tuscany*. The Tuscany
> > >  > runtime
> > >  > >  > will start up adding
> > >  > >  > the helloworld composition to its domain and will make the
> > helloworld
> > >  > web
> > >  > >  > service live.
> > >  > >  >
> > >  > >  > The Eclipse console will show the following messages.
> > >  > >  >
> > >  > >  >
> > >  > >  >
> > >  > >
> > >  > > >  Next Launch your Web browser and enter the following address:
> > >  > >  >
> > >  > >  > http://localhost:8080/HelloWorld?wsdl
> > >  > >  >
> > >  > >
> > >  > > > You should now have your web service live, and the url should
> > give you
> > >  > >  > back a generated wsdl for the service.
> > >  > >  >
> > >  > >
> > >  > >
> > >  > > > <?xml version="1.0" encoding="UTF-8"?>
> > >  > >  > <wsdl:definitions targetNamespace="http://helloworld"
> > xmlns:soap12="
> > >  > http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="
> > http://helloworld"
> > >  > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > >  > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
> > >  > http://org.apache.axis2/xsd" xmlns:wsaw="
> > >  > http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="
> > >  > http://www.w3.org/2001/XMLSchema" xmlns:soap="
> > >  > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
> > >  > http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
> > >  > >  >     <xs:schema attributeFormDefault="qualified"
> > >  > elementFormDefault="qualified" targetNamespace="http://helloworld"
> > >  > xmlns:ns="http://helloworld">         <xs:element name="sayHello">
> > >  > >  >             <xs:complexType>
> > >  > >  >                <xs:sequence>
> > >  > >  >                   <xs:element minOccurs="0" name="param0"
> > >  > nillable="true" type="xs:string"/>
> > >  > >  >                </xs:sequence>
> > >  > >  >             </xs:complexType>
> > >  > >  >
> > >  > >  >          </xs:element>
> > >  > >  >          <xs:element name="sayHelloResponse">
> > >  > >  >             <xs:complexType>
> > >  > >  >                <xs:sequence>
> > >  > >  >                   <xs:element minOccurs="0" name="return"
> > >  > nillable="true" type="xs:string"/>
> > >  > >  >                </xs:sequence>
> > >  > >  >             </xs:complexType>
> > >  > >  >          </xs:element>
> > >  > >  >       </xs:schema>
> > >  > >  >
> > >  > >  >   </wsdl:types>
> > >  > >  >   <wsdl:message name="sayHelloRequest">
> > >  > >  >     <wsdl:part name="parameters" element="ns0:sayHello">
> > >  > >  >     </wsdl:part>
> > >  > >  >   </wsdl:message>
> > >  > >  >   <wsdl:message name="sayHelloResponse">
> > >  > >  >     <wsdl:part name="parameters"
> > element="ns0:sayHelloResponse">
> > >  > >  >     </wsdl:part>
> > >  > >  >   </wsdl:message>
> > >  > >  >
> > >  > >  >   <wsdl:portType name="HelloWorldPortType">
> > >  > >  >     <wsdl:operation name="sayHello">
> > >  > >  >       <wsdl:input message="ns0:sayHelloRequest"
> > >  > wsaw:Action="urn:sayHello">
> > >  > >  >     </wsdl:input>
> > >  > >  >       <wsdl:output message="ns0:sayHelloResponse"
> > >  > wsaw:Action="urn:sayHelloResponse">
> > >  > >  >     </wsdl:output>
> > >  > >  >     </wsdl:operation>
> > >  > >  >   </wsdl:portType>
> > >  > >  >   <wsdl:binding name="HelloWorldHttpBinding"
> > >  > type="ns0:HelloWorldPortType">
> > >  > >  >
> > >  > >  >     <http:binding verb="POST"/>
> > >  > >  >     <wsdl:operation name="sayHello">
> > >  > >  >       <http:operation location="HelloWorld/sayHello"/>
> > >  > >  >       <wsdl:input>
> > >  > >  >         <mime:content part="sayHello" type="text/xml"/>
> > >  > >  >       </wsdl:input>
> > >  > >  >       <wsdl:output>
> > >  > >  >         <mime:content part="sayHello" type="text/xml"/>
> > >  > >  >       </wsdl:output>
> > >  > >  >
> > >  > >  >     </wsdl:operation>
> > >  > >  >   </wsdl:binding>
> > >  > >  >   <wsdl:binding name="HelloWorldSOAP11Binding"
> > >  > type="ns0:HelloWorldPortType">
> > >  > >  >     <soap:binding style="document" transport="
> > >  > http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation
> > >  > name="sayHello">
> > >  > >  >       <soap:operation soapAction="urn:sayHello"
> > style="document"/>
> > >  > >  >       <wsdl:input>
> > >  > >  >         <soap:body use="literal"/>
> > >  > >  >       </wsdl:input>
> > >  > >  >
> > >  > >  >       <wsdl:output>
> > >  > >  >         <soap:body use="literal"/>
> > >  > >  >       </wsdl:output>
> > >  > >  >     </wsdl:operation>
> > >  > >  >   </wsdl:binding>
> > >  > >  >   <wsdl:service name="HelloWorld">
> > >  > >  >     <wsdl:port name="HelloWorldSOAP11port_http"
> > >  > binding="ns0:HelloWorldSOAP11Binding">
> > >  > >  >       <soap:address location="
> > http://192.168.209.1:8080/HelloWorld"/>
> > >  >    </wsdl:port>
> > >  > >  >
> > >  > >  >     <wsdl:port name="HelloWorldHttpport"
> > >  > binding="ns0:HelloWorldHttpBinding">
> > >  > >  >       <http:address location="
> > http://192.168.209.1:8080/HelloWorld"/>
> > >  >    </wsdl:port>
> > >  > >  >   </wsdl:service>
> > >  > >  > </wsdl:definitions>
> > >  > >  >
> > >  > >  >      Powered by Atlassian Confluence<
> > >  >
> > http://www.atlassian.com/software/confluence/default.jsp?clicked=footer
> > >(Version:
> > >  > 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
> > >  > >  > request <
> > http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470
> > >  > >
> > >  > >
> > >  > >
> > >  > > >
> > >  > >  > Unsubscribe or edit your notifications preferences<
> > >  > http://cwiki.apache.org/confluence/users/viewnotifications.action>
> > >  > >  >
> > >  > >
> > >  >
> > >  >
> > >  >
> > >  > --
> > >  > Luciano Resende
> > >  > Apache Tuscany Committer
> > >  > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende><
> > http://people.apache.org/%7Elresende>
> > >  > http://lresende.blogspot.com/
> > >  >
> > >
> >
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende>
> > http://lresende.blogspot.com/
> >
>
>

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by ant elder <an...@gmail.com>.
Have you got that example working with the eclipse plugin from the 1.2 RC4
release? I've tried but it crashes with the exception below. It also starts
up all sorts of endpoints, i guess for the workspace stuff, is there any way
to prevent that?

   ...ant

Caused by: javax.xml.stream.XMLStreamException: Non-default namespace can
not map to empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents
    at
com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
    at
com.ctc.wstx.sw.BaseNsStreamWriter.setPrefix(BaseNsStreamWriter.java:210)
    at
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writeQNamePrefix(BaseStAXArtifactProcessor.java:414)
    at
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor$XAttr.writePrefix(BaseStAXArtifactProcessor.java:493)
    at
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeAttributePrefixes(BaseStAXArtifactProcessor.java:302)
    at
org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor.writeStart(BaseStAXArtifactProcessor.java:220)
    at
org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.writeStart(BaseAssemblyProcessor.java:137)
    at
org.apache.tuscany.sca.assembly.xml.CompositeProcessor.write(CompositeProcessor.java:504)
    at
org.apache.tuscany.sca.workspace.admin.impl.DeployedCompositeCollectionImpl.writeCompositeCollection(DeployedCompositeCollectionImpl.java:382)

On Thu, Apr 24, 2008 at 3:20 PM, Luciano Resende <lu...@gmail.com>
wrote:

> Totally +1, What I had in mind was to keep it simple and usable by
> someone that does not know much of SCA. What if we create a "First
> Steps" series of articles ?
>
> On Thu, Apr 24, 2008 at 2:14 AM, ant elder <an...@gmail.com> wrote:
> > I asked as I'd like to help expand it but don't want to step on your
> toes.
> >  Adding web clients sounds good, expanding the WS bit with how to use
> other
> >  databindings would be useful, maybe something on other bindings like
> JMS,
> >  then it could go on with what to do when you want to run it out side of
> >  eclipse - how to make contribution jars or run standalone or in webapps
> etc.
> >  I like that that page is nice and simple and clear and focused so it
> would
> >  be good to try to maintain that, maybe have separate pages for each
> topic
> >  but linked together and in the same sort of style as that one. WDYT?
> >
> >    ...ant
> >
> >  On Wed, Apr 23, 2008 at 5:17 PM, Luciano Resende <lu...@gmail.com>
> >  wrote:
> >
> >
> >
> >  > Yes, it's on my todo list for the next couple days...
> >  >
> >  > Do you have any ideas for what type of extensions to use ? Maybe
> >  > JSON-RPC and use a quick web2.0 client app to consume the service ?
> >  >
> >  > On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org>
> wrote:
> >  > > This looks really good, do you have plans to extend it further like
> with
> >  > >  adding clients or other extension types?
> >  > >
> >  > >    ...ant
> >  > >
> >  > >  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
> >  > >
> >  > >  >    Page Edited : TUSCANY<
> >  > http://cwiki.apache.org/confluence/display/TUSCANY>: Build
> >  > >  > your first Web Services with Tuscany<
> >  >
> http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> >  > >
> >  > >  >
> >  > >  > Build your first Web Services with Tuscany<
> >  >
> http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> >has
> >  > been edited by Luciano
> >  > >  > Resende<
> >  > http://cwiki.apache.org/confluence/display/%7Elresende@apache.org>
> (Apr
> >  > >  > 22, 2008).
> >  > >  >
> >  > >  > (View changes)<
> >  >
> http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6
> >  > >
> >  > >  > Content:
> >  > >
> >  > > > Build your first Web Services with Tuscany
> >  > >  >
> >  > >  > This guide will give you step by step instructions on how to
> build
> >  > your
> >  > >  > first web services.
> >  > >  > The first part, we will learn how we can add the Tuscany Runtime
> to
> >  > >  > Eclipse IDE.
> >  > >  > The second part, will show how easy is to create a webservices
> using
> >  > >  > Apache Tuscany.
> >  > >
> >  > > > Install Tuscany Eclipse Plugins 1.1
> >  > >  > Install the Tuscany Eclipse Plugin
> >  > >  >
> >  > >  > The first thing you do is to start Eclipse and go to *Help ->
> >  > Software
> >  > >  > Updates -> Find and Install*,
> >  > >  > select "Search for new features to install" and then click next
> >  > >  >
> >  > >  > On the next dialog, click on *"New Remote Site..."* to create a
> new
> >  > site
> >  > >  > entry. Give it a name such as
> >  > >  > "Tuscany" and add the site URL as *
> >  > >  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> >  > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> >  > >  >
> >  > >  > Make sure the *"Remote  Site"* that was just created is selected,
> and
> >  > >  > click *"Finish"*
> >  > >  >
> >  > >  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*, and
> then,
> >  > on
> >  > >  > the next dialog, click *"Finish"*
> >  > >  >
> >  > >  > Accept the *"Plugin License"*
> >  > >  >
> >  > >  > and next click on *"Install All"*
> >  > >  >
> >  > >  > When asked to *"restart eclipse"*, click the  *"yes"* button.
> >  > >  >
> >  > >  > Create your Service Business Logic Create a Java Project
> >  > >
> >  > > >
> >  > >  > In this step you create a Java Project in Eclipse to hold the
> >  > composite
> >  > >  > service application.
> >  > >  > Click on the *New Java Project* button   in the toolbar to launch
> the
> >  > >
> >  > > > project creation dialog.
> >  > >  > Next you enter "ws" as the *Project name*, and for *Project
> Layout*
> >  > select
> >  > >  > *Create separate*
> >  > >  > *folders for sources and class files.*
> >  > >
> >  > > >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  > Hit the *Next* button, and on the following page go to the
> >  > *Libraries*tab. Use the
> >  > >  > *Add Library...*
> >  > >  > button on the right to add the *Tuscany Library* library to the
> >  > project.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Hit the *Finish* button to complete the *New Java Project* dialog
> to
> >  > >  > create the "ws" java project.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Construct Services
> >  > >  >
> >  > >  > First you create the "helloworld" package folders into which
> later in
> >  > this
> >  > >  > step you place service implementations.
> >  > >  > Select the "ws" project and click on the *New Java Package*
> button in
> >  > the
> >  > >
> >  > > > toolbar to launch
> >  > >  > the package creation dialog.
> >  > >  >
> >  > >  > Next you enter "helloworld" as the package *Name*, and press the
> >  > *Finish*button to complete the
> >  > >  > dialog.
> >  > >  >
> >  > >  >
> >  > >
> >  > > > *HelloWorld*
> >  > >  >
> >  > >  > In this step you create the HelloWorld service interface and
> >  > >  > implementation.
> >  > >  > Select the "helloworld" package. Next you click on the dropdown
> arrow
> >  > next
> >  > >  > to the *New Java Class*
> >  > >  > button    and select the *New Java Interface*    option from the
> >  > dropdown
> >  > >
> >  > > > list. In the dialog
> >  > >  > enter "HelloWorld" as the *Name* of the interface and select the
> >  > Finish
> >  > >  > button to complete the dialog.
> >  > >  > The Java editor will open on the new created Java interface.
> Replace
> >  > the
> >  > >  > content of the editor by
> >  > >  > *copy-paste* of the following Java interface code snippet.
> >  > >  >
> >  > >
> >  > > > package helloworld;import org.osoa.sca.annotations.Remotable;
> >  > >  > @Remotablepublic interface HelloWorld {
> >  > >  >     String sayHello(String name);
> >  > >  > }
> >  > >  >
> >  > >
> >  > > >  Select the "helloworld" package again. Select the *New Java
> Class*
> >  > button
> >  > >
> >  > > > . In the dialog enter
> >  > >  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as the
> >  > >  > interface this class implements, and
> >  > >  > then select *Finish* to complete the dialog.
> >  > >  >
> >  > >  > The Java editor will open on the new created Java class. Replace
> the
> >  > >  > content of the editor by
> >  > >  > *copy-paste* of the following Java class code snippet.
> >  > >  >
> >  > >
> >  > > > package helloworld;public class HelloWorldImpl implements
> HelloWorld {
> >  > >  >       public String sayHello(String name) {
> >  > >  >               return "Hello " + name;
> >  > >  >       }
> >  > >  > }
> >  > >  >
> >  > >
> >  > > >  After completing these steps the content of the "ws" project will
> >  > look as
> >  > >  > follows.
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Compose Services
> >  > >  >
> >  > >  > Now that you have all the required service implementations you
> >  > compose
> >  > >  > them together to provide
> >  > >  > the store composite service. The composition is stored in a
> >  > .composite
> >  > >  > file.
> >  > >  >
> >  > >  > Select the "src" folder of the "ws" project. *Right click* to get
> the
> >  > >  > context menu, select *New*, and
> >  > >  > then *File*. In the *New File* dialog enter
> "helloworld.composite"
> >  > for the
> >  > >  > *File name*, and then select *Finish*
> >  > >  > to complete the dialog.
> >  > >  >
> >  > >  > The Text editor will open on the new created composite file.
> Replace
> >  > the
> >  > >  > content of the editor by
> >  > >  > *copy-paste* of the following composite snippet.
> >  > >  >
> >  > >
> >  > > > <?xml version="1.0" encoding="UTF-8"?>
> >  > >  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"
> >  >         xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
> >  >       xmlns:c="http://helloworld"
> name="helloworld">
> >  > >  >
> >  > >  >
> >  > >  >       <component name="HelloWorldComponent">
> >  > >  >               <implementation.java
> >  > class="helloworld.HelloWorldImpl"/>
> >  > >  >               <service name="HelloWorld">
> >  > >  >                       <binding.ws uri="
> >  > http://localhost:8080/HelloWorld"/>            </service>
> >  > >  >       </component>
> >  > >  > </composite>
> >  > >  >
> >  > >
> >  > > >  After completing these steps the content of the "store" project
> will
> >  > look
> >  > >  > as follows.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Congratulations you completed your 1st composite service
> applications,
> >  > now
> >  > >  > its time to take it into
> >  > >  > action.
> >  > >
> >  > > > Use Services
> >  > >  >
> >  > >  > In this step you launch and use the ws composite service
> application
> >  > you
> >  > >  > created.
> >  > >  >
> >  > >  > First select the "helloworld.composite" file, in your "ws"
> project.
> >  > *Right
> >  > >  > click* to get the
> >  > >  > context menu, select *Run As*, and then *Tuscany*. The Tuscany
> >  > runtime
> >  > >  > will start up adding
> >  > >  > the helloworld composition to its domain and will make the
> helloworld
> >  > web
> >  > >  > service live.
> >  > >  >
> >  > >  > The Eclipse console will show the following messages.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > >  Next Launch your Web browser and enter the following address:
> >  > >  >
> >  > >  > http://localhost:8080/HelloWorld?wsdl
> >  > >  >
> >  > >
> >  > > > You should now have your web service live, and the url should give
> you
> >  > >  > back a generated wsdl for the service.
> >  > >  >
> >  > >
> >  > >
> >  > > > <?xml version="1.0" encoding="UTF-8"?>
> >  > >  > <wsdl:definitions targetNamespace="http://helloworld"
> xmlns:soap12="
> >  > http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="http://helloworld
> "
> >  > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> >  > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
> >  > http://org.apache.axis2/xsd" xmlns:wsaw="
> >  > http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="
> >  > http://www.w3.org/2001/XMLSchema" xmlns:soap="
> >  > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
> >  > http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
> >  > >  >     <xs:schema attributeFormDefault="qualified"
> >  > elementFormDefault="qualified" targetNamespace="http://helloworld"
> >  > xmlns:ns="http://helloworld">         <xs:element name="sayHello">
> >  > >  >             <xs:complexType>
> >  > >  >                <xs:sequence>
> >  > >  >                   <xs:element minOccurs="0" name="param0"
> >  > nillable="true" type="xs:string"/>
> >  > >  >                </xs:sequence>
> >  > >  >             </xs:complexType>
> >  > >  >
> >  > >  >          </xs:element>
> >  > >  >          <xs:element name="sayHelloResponse">
> >  > >  >             <xs:complexType>
> >  > >  >                <xs:sequence>
> >  > >  >                   <xs:element minOccurs="0" name="return"
> >  > nillable="true" type="xs:string"/>
> >  > >  >                </xs:sequence>
> >  > >  >             </xs:complexType>
> >  > >  >          </xs:element>
> >  > >  >       </xs:schema>
> >  > >  >
> >  > >  >   </wsdl:types>
> >  > >  >   <wsdl:message name="sayHelloRequest">
> >  > >  >     <wsdl:part name="parameters" element="ns0:sayHello">
> >  > >  >     </wsdl:part>
> >  > >  >   </wsdl:message>
> >  > >  >   <wsdl:message name="sayHelloResponse">
> >  > >  >     <wsdl:part name="parameters" element="ns0:sayHelloResponse">
> >  > >  >     </wsdl:part>
> >  > >  >   </wsdl:message>
> >  > >  >
> >  > >  >   <wsdl:portType name="HelloWorldPortType">
> >  > >  >     <wsdl:operation name="sayHello">
> >  > >  >       <wsdl:input message="ns0:sayHelloRequest"
> >  > wsaw:Action="urn:sayHello">
> >  > >  >     </wsdl:input>
> >  > >  >       <wsdl:output message="ns0:sayHelloResponse"
> >  > wsaw:Action="urn:sayHelloResponse">
> >  > >  >     </wsdl:output>
> >  > >  >     </wsdl:operation>
> >  > >  >   </wsdl:portType>
> >  > >  >   <wsdl:binding name="HelloWorldHttpBinding"
> >  > type="ns0:HelloWorldPortType">
> >  > >  >
> >  > >  >     <http:binding verb="POST"/>
> >  > >  >     <wsdl:operation name="sayHello">
> >  > >  >       <http:operation location="HelloWorld/sayHello"/>
> >  > >  >       <wsdl:input>
> >  > >  >         <mime:content part="sayHello" type="text/xml"/>
> >  > >  >       </wsdl:input>
> >  > >  >       <wsdl:output>
> >  > >  >         <mime:content part="sayHello" type="text/xml"/>
> >  > >  >       </wsdl:output>
> >  > >  >
> >  > >  >     </wsdl:operation>
> >  > >  >   </wsdl:binding>
> >  > >  >   <wsdl:binding name="HelloWorldSOAP11Binding"
> >  > type="ns0:HelloWorldPortType">
> >  > >  >     <soap:binding style="document" transport="
> >  > http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation
> >  > name="sayHello">
> >  > >  >       <soap:operation soapAction="urn:sayHello"
> style="document"/>
> >  > >  >       <wsdl:input>
> >  > >  >         <soap:body use="literal"/>
> >  > >  >       </wsdl:input>
> >  > >  >
> >  > >  >       <wsdl:output>
> >  > >  >         <soap:body use="literal"/>
> >  > >  >       </wsdl:output>
> >  > >  >     </wsdl:operation>
> >  > >  >   </wsdl:binding>
> >  > >  >   <wsdl:service name="HelloWorld">
> >  > >  >     <wsdl:port name="HelloWorldSOAP11port_http"
> >  > binding="ns0:HelloWorldSOAP11Binding">
> >  > >  >       <soap:address location="
> http://192.168.209.1:8080/HelloWorld"/>
> >  >    </wsdl:port>
> >  > >  >
> >  > >  >     <wsdl:port name="HelloWorldHttpport"
> >  > binding="ns0:HelloWorldHttpBinding">
> >  > >  >       <http:address location="
> http://192.168.209.1:8080/HelloWorld"/>
> >  >    </wsdl:port>
> >  > >  >   </wsdl:service>
> >  > >  > </wsdl:definitions>
> >  > >  >
> >  > >  >      Powered by Atlassian Confluence<
> >  >
> http://www.atlassian.com/software/confluence/default.jsp?clicked=footer
> >(Version:
> >  > 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
> >  > >  > request <
> http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470
> >  > >
> >  > >
> >  > >
> >  > > >
> >  > >  > Unsubscribe or edit your notifications preferences<
> >  > http://cwiki.apache.org/confluence/users/viewnotifications.action>
> >  > >  >
> >  > >
> >  >
> >  >
> >  >
> >  > --
> >  > Luciano Resende
> >  > Apache Tuscany Committer
> >  > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende><
> http://people.apache.org/%7Elresende>
> >  > http://lresende.blogspot.com/
> >  >
> >
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by ant elder <an...@gmail.com>.
I started doing one of these for a simple JSP webapp but its a bit tedious
with all the screen captures isn't it. There are programs that automate this
by recording your screen into a flash movie -
http://www.debugmode.com/wink/is a good one and its free - so how
about adding these along with the text
on the Tuscany web site? I've created one to try this out, takes a little
practice and this one is still quite rough but it gives an idea of what
could be possible -
http://people.apache.org/~antelder/tuscany/demo/helloJSP.htm

WDYT?

   ...ant

On Thu, Apr 24, 2008 at 3:20 PM, Luciano Resende <lu...@gmail.com>
wrote:

> Totally +1, What I had in mind was to keep it simple and usable by
> someone that does not know much of SCA. What if we create a "First
> Steps" series of articles ?
>
> On Thu, Apr 24, 2008 at 2:14 AM, ant elder <an...@gmail.com> wrote:
> > I asked as I'd like to help expand it but don't want to step on your
> toes.
> >  Adding web clients sounds good, expanding the WS bit with how to use
> other
> >  databindings would be useful, maybe something on other bindings like
> JMS,
> >  then it could go on with what to do when you want to run it out side of
> >  eclipse - how to make contribution jars or run standalone or in webapps
> etc.
> >  I like that that page is nice and simple and clear and focused so it
> would
> >  be good to try to maintain that, maybe have separate pages for each
> topic
> >  but linked together and in the same sort of style as that one. WDYT?
> >
> >    ...ant
> >
> >  On Wed, Apr 23, 2008 at 5:17 PM, Luciano Resende <lu...@gmail.com>
> >  wrote:
> >
> >
> >
> >  > Yes, it's on my todo list for the next couple days...
> >  >
> >  > Do you have any ideas for what type of extensions to use ? Maybe
> >  > JSON-RPC and use a quick web2.0 client app to consume the service ?
> >  >
> >  > On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org>
> wrote:
> >  > > This looks really good, do you have plans to extend it further like
> with
> >  > >  adding clients or other extension types?
> >  > >
> >  > >    ...ant
> >  > >
> >  > >  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
> >  > >
> >  > >  >    Page Edited : TUSCANY<
> >  > http://cwiki.apache.org/confluence/display/TUSCANY>: Build
> >  > >  > your first Web Services with Tuscany<
> >  >
> http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> >  > >
> >  > >  >
> >  > >  > Build your first Web Services with Tuscany<
> >  >
> http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> >has
> >  > been edited by Luciano
> >  > >  > Resende<
> >  > http://cwiki.apache.org/confluence/display/%7Elresende@apache.org>
> (Apr
> >  > >  > 22, 2008).
> >  > >  >
> >  > >  > (View changes)<
> >  >
> http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6
> >  > >
> >  > >  > Content:
> >  > >
> >  > > > Build your first Web Services with Tuscany
> >  > >  >
> >  > >  > This guide will give you step by step instructions on how to
> build
> >  > your
> >  > >  > first web services.
> >  > >  > The first part, we will learn how we can add the Tuscany Runtime
> to
> >  > >  > Eclipse IDE.
> >  > >  > The second part, will show how easy is to create a webservices
> using
> >  > >  > Apache Tuscany.
> >  > >
> >  > > > Install Tuscany Eclipse Plugins 1.1
> >  > >  > Install the Tuscany Eclipse Plugin
> >  > >  >
> >  > >  > The first thing you do is to start Eclipse and go to *Help ->
> >  > Software
> >  > >  > Updates -> Find and Install*,
> >  > >  > select "Search for new features to install" and then click next
> >  > >  >
> >  > >  > On the next dialog, click on *"New Remote Site..."* to create a
> new
> >  > site
> >  > >  > entry. Give it a name such as
> >  > >  > "Tuscany" and add the site URL as *
> >  > >  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> >  > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> >  > >  >
> >  > >  > Make sure the *"Remote  Site"* that was just created is
> selected, and
> >  > >  > click *"Finish"*
> >  > >  >
> >  > >  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*, and
> then,
> >  > on
> >  > >  > the next dialog, click *"Finish"*
> >  > >  >
> >  > >  > Accept the *"Plugin License"*
> >  > >  >
> >  > >  > and next click on *"Install All"*
> >  > >  >
> >  > >  > When asked to *"restart eclipse"*, click the  *"yes"* button.
> >  > >  >
> >  > >  > Create your Service Business Logic Create a Java Project
> >  > >
> >  > > >
> >  > >  > In this step you create a Java Project in Eclipse to hold the
> >  > composite
> >  > >  > service application.
> >  > >  > Click on the *New Java Project* button   in the toolbar to
> launch the
> >  > >
> >  > > > project creation dialog.
> >  > >  > Next you enter "ws" as the *Project name*, and for *Project
> Layout*
> >  > select
> >  > >  > *Create separate*
> >  > >  > *folders for sources and class files.*
> >  > >
> >  > > >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  > Hit the *Next* button, and on the following page go to the
> >  > *Libraries*tab. Use the
> >  > >  > *Add Library...*
> >  > >  > button on the right to add the *Tuscany Library* library to the
> >  > project.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Hit the *Finish* button to complete the *New Java Project* dialog
> to
> >  > >  > create the "ws" java project.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Construct Services
> >  > >  >
> >  > >  > First you create the "helloworld" package folders into which
> later in
> >  > this
> >  > >  > step you place service implementations.
> >  > >  > Select the "ws" project and click on the *New Java Package*
> button in
> >  > the
> >  > >
> >  > > > toolbar to launch
> >  > >  > the package creation dialog.
> >  > >  >
> >  > >  > Next you enter "helloworld" as the package *Name*, and press the
> >  > *Finish*button to complete the
> >  > >  > dialog.
> >  > >  >
> >  > >  >
> >  > >
> >  > > > *HelloWorld*
> >  > >  >
> >  > >  > In this step you create the HelloWorld service interface and
> >  > >  > implementation.
> >  > >  > Select the "helloworld" package. Next you click on the dropdown
> arrow
> >  > next
> >  > >  > to the *New Java Class*
> >  > >  > button    and select the *New Java Interface*    option from the
> >  > dropdown
> >  > >
> >  > > > list. In the dialog
> >  > >  > enter "HelloWorld" as the *Name* of the interface and select the
> >  > Finish
> >  > >  > button to complete the dialog.
> >  > >  > The Java editor will open on the new created Java interface.
> Replace
> >  > the
> >  > >  > content of the editor by
> >  > >  > *copy-paste* of the following Java interface code snippet.
> >  > >  >
> >  > >
> >  > > > package helloworld;import org.osoa.sca.annotations.Remotable;
> >  > >  > @Remotablepublic interface HelloWorld {
> >  > >  >     String sayHello(String name);
> >  > >  > }
> >  > >  >
> >  > >
> >  > > >  Select the "helloworld" package again. Select the *New Java
> Class*
> >  > button
> >  > >
> >  > > > . In the dialog enter
> >  > >  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as
> the
> >  > >  > interface this class implements, and
> >  > >  > then select *Finish* to complete the dialog.
> >  > >  >
> >  > >  > The Java editor will open on the new created Java class. Replace
> the
> >  > >  > content of the editor by
> >  > >  > *copy-paste* of the following Java class code snippet.
> >  > >  >
> >  > >
> >  > > > package helloworld;public class HelloWorldImpl implements
> HelloWorld {
> >  > >  >       public String sayHello(String name) {
> >  > >  >               return "Hello " + name;
> >  > >  >       }
> >  > >  > }
> >  > >  >
> >  > >
> >  > > >  After completing these steps the content of the "ws" project
> will
> >  > look as
> >  > >  > follows.
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Compose Services
> >  > >  >
> >  > >  > Now that you have all the required service implementations you
> >  > compose
> >  > >  > them together to provide
> >  > >  > the store composite service. The composition is stored in a
> >  > .composite
> >  > >  > file.
> >  > >  >
> >  > >  > Select the "src" folder of the "ws" project. *Right click* to
> get the
> >  > >  > context menu, select *New*, and
> >  > >  > then *File*. In the *New File* dialog enter
> "helloworld.composite"
> >  > for the
> >  > >  > *File name*, and then select *Finish*
> >  > >  > to complete the dialog.
> >  > >  >
> >  > >  > The Text editor will open on the new created composite file.
> Replace
> >  > the
> >  > >  > content of the editor by
> >  > >  > *copy-paste* of the following composite snippet.
> >  > >  >
> >  > >
> >  > > > <?xml version="1.0" encoding="UTF-8"?>
> >  > >  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"
> >  >         xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
> >  >       xmlns:c="http://helloworld"
> name="helloworld">
> >  > >  >
> >  > >  >
> >  > >  >       <component name="HelloWorldComponent">
> >  > >  >               <implementation.java
> >  > class="helloworld.HelloWorldImpl"/>
> >  > >  >               <service name="HelloWorld">
> >  > >  >                       <binding.ws uri="
> >  > http://localhost:8080/HelloWorld"/>            </service>
> >  > >  >       </component>
> >  > >  > </composite>
> >  > >  >
> >  > >
> >  > > >  After completing these steps the content of the "store" project
> will
> >  > look
> >  > >  > as follows.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > > Congratulations you completed your 1st composite service
> applications,
> >  > now
> >  > >  > its time to take it into
> >  > >  > action.
> >  > >
> >  > > > Use Services
> >  > >  >
> >  > >  > In this step you launch and use the ws composite service
> application
> >  > you
> >  > >  > created.
> >  > >  >
> >  > >  > First select the "helloworld.composite" file, in your "ws"
> project.
> >  > *Right
> >  > >  > click* to get the
> >  > >  > context menu, select *Run As*, and then *Tuscany*. The Tuscany
> >  > runtime
> >  > >  > will start up adding
> >  > >  > the helloworld composition to its domain and will make the
> helloworld
> >  > web
> >  > >  > service live.
> >  > >  >
> >  > >  > The Eclipse console will show the following messages.
> >  > >  >
> >  > >  >
> >  > >  >
> >  > >
> >  > > >  Next Launch your Web browser and enter the following address:
> >  > >  >
> >  > >  > http://localhost:8080/HelloWorld?wsdl
> >  > >  >
> >  > >
> >  > > > You should now have your web service live, and the url should
> give you
> >  > >  > back a generated wsdl for the service.
> >  > >  >
> >  > >
> >  > >
> >  > > > <?xml version="1.0" encoding="UTF-8"?>
> >  > >  > <wsdl:definitions targetNamespace="http://helloworld"
> xmlns:soap12="
> >  > http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="http://helloworld
> "
> >  > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> >  > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
> >  > http://org.apache.axis2/xsd" xmlns:wsaw="
> >  > http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="
> >  > http://www.w3.org/2001/XMLSchema" xmlns:soap="
> >  > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
> >  > http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
> >  > >  >     <xs:schema attributeFormDefault="qualified"
> >  > elementFormDefault="qualified" targetNamespace="http://helloworld"
> >  > xmlns:ns="http://helloworld">         <xs:element name="sayHello">
> >  > >  >             <xs:complexType>
> >  > >  >                <xs:sequence>
> >  > >  >                   <xs:element minOccurs="0" name="param0"
> >  > nillable="true" type="xs:string"/>
> >  > >  >                </xs:sequence>
> >  > >  >             </xs:complexType>
> >  > >  >
> >  > >  >          </xs:element>
> >  > >  >          <xs:element name="sayHelloResponse">
> >  > >  >             <xs:complexType>
> >  > >  >                <xs:sequence>
> >  > >  >                   <xs:element minOccurs="0" name="return"
> >  > nillable="true" type="xs:string"/>
> >  > >  >                </xs:sequence>
> >  > >  >             </xs:complexType>
> >  > >  >          </xs:element>
> >  > >  >       </xs:schema>
> >  > >  >
> >  > >  >   </wsdl:types>
> >  > >  >   <wsdl:message name="sayHelloRequest">
> >  > >  >     <wsdl:part name="parameters" element="ns0:sayHello">
> >  > >  >     </wsdl:part>
> >  > >  >   </wsdl:message>
> >  > >  >   <wsdl:message name="sayHelloResponse">
> >  > >  >     <wsdl:part name="parameters" element="ns0:sayHelloResponse">
> >  > >  >     </wsdl:part>
> >  > >  >   </wsdl:message>
> >  > >  >
> >  > >  >   <wsdl:portType name="HelloWorldPortType">
> >  > >  >     <wsdl:operation name="sayHello">
> >  > >  >       <wsdl:input message="ns0:sayHelloRequest"
> >  > wsaw:Action="urn:sayHello">
> >  > >  >     </wsdl:input>
> >  > >  >       <wsdl:output message="ns0:sayHelloResponse"
> >  > wsaw:Action="urn:sayHelloResponse">
> >  > >  >     </wsdl:output>
> >  > >  >     </wsdl:operation>
> >  > >  >   </wsdl:portType>
> >  > >  >   <wsdl:binding name="HelloWorldHttpBinding"
> >  > type="ns0:HelloWorldPortType">
> >  > >  >
> >  > >  >     <http:binding verb="POST"/>
> >  > >  >     <wsdl:operation name="sayHello">
> >  > >  >       <http:operation location="HelloWorld/sayHello"/>
> >  > >  >       <wsdl:input>
> >  > >  >         <mime:content part="sayHello" type="text/xml"/>
> >  > >  >       </wsdl:input>
> >  > >  >       <wsdl:output>
> >  > >  >         <mime:content part="sayHello" type="text/xml"/>
> >  > >  >       </wsdl:output>
> >  > >  >
> >  > >  >     </wsdl:operation>
> >  > >  >   </wsdl:binding>
> >  > >  >   <wsdl:binding name="HelloWorldSOAP11Binding"
> >  > type="ns0:HelloWorldPortType">
> >  > >  >     <soap:binding style="document" transport="
> >  > http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation
> >  > name="sayHello">
> >  > >  >       <soap:operation soapAction="urn:sayHello"
> style="document"/>
> >  > >  >       <wsdl:input>
> >  > >  >         <soap:body use="literal"/>
> >  > >  >       </wsdl:input>
> >  > >  >
> >  > >  >       <wsdl:output>
> >  > >  >         <soap:body use="literal"/>
> >  > >  >       </wsdl:output>
> >  > >  >     </wsdl:operation>
> >  > >  >   </wsdl:binding>
> >  > >  >   <wsdl:service name="HelloWorld">
> >  > >  >     <wsdl:port name="HelloWorldSOAP11port_http"
> >  > binding="ns0:HelloWorldSOAP11Binding">
> >  > >  >       <soap:address location="
> http://192.168.209.1:8080/HelloWorld"/>
> >  >    </wsdl:port>
> >  > >  >
> >  > >  >     <wsdl:port name="HelloWorldHttpport"
> >  > binding="ns0:HelloWorldHttpBinding">
> >  > >  >       <http:address location="
> http://192.168.209.1:8080/HelloWorld"/>
> >  >    </wsdl:port>
> >  > >  >   </wsdl:service>
> >  > >  > </wsdl:definitions>
> >  > >  >
> >  > >  >      Powered by Atlassian Confluence<
> >  >
> http://www.atlassian.com/software/confluence/default.jsp?clicked=footer
> >(Version:
> >  > 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
> >  > >  > request <
> http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470
> >  > >
> >  > >
> >  > >
> >  > > >
> >  > >  > Unsubscribe or edit your notifications preferences<
> >  > http://cwiki.apache.org/confluence/users/viewnotifications.action>
> >  > >  >
> >  > >
> >  >
> >  >
> >  >
> >  > --
> >  > Luciano Resende
> >  > Apache Tuscany Committer
> >  > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende><
> http://people.apache.org/%7Elresende>
> >  > http://lresende.blogspot.com/
> >  >
> >
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by Luciano Resende <lu...@gmail.com>.
Totally +1, What I had in mind was to keep it simple and usable by
someone that does not know much of SCA. What if we create a "First
Steps" series of articles ?

On Thu, Apr 24, 2008 at 2:14 AM, ant elder <an...@gmail.com> wrote:
> I asked as I'd like to help expand it but don't want to step on your toes.
>  Adding web clients sounds good, expanding the WS bit with how to use other
>  databindings would be useful, maybe something on other bindings like JMS,
>  then it could go on with what to do when you want to run it out side of
>  eclipse - how to make contribution jars or run standalone or in webapps etc.
>  I like that that page is nice and simple and clear and focused so it would
>  be good to try to maintain that, maybe have separate pages for each topic
>  but linked together and in the same sort of style as that one. WDYT?
>
>    ...ant
>
>  On Wed, Apr 23, 2008 at 5:17 PM, Luciano Resende <lu...@gmail.com>
>  wrote:
>
>
>
>  > Yes, it's on my todo list for the next couple days...
>  >
>  > Do you have any ideas for what type of extensions to use ? Maybe
>  > JSON-RPC and use a quick web2.0 client app to consume the service ?
>  >
>  > On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org> wrote:
>  > > This looks really good, do you have plans to extend it further like with
>  > >  adding clients or other extension types?
>  > >
>  > >    ...ant
>  > >
>  > >  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
>  > >
>  > >  >    Page Edited : TUSCANY<
>  > http://cwiki.apache.org/confluence/display/TUSCANY>: Build
>  > >  > your first Web Services with Tuscany<
>  > http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
>  > >
>  > >  >
>  > >  > Build your first Web Services with Tuscany<
>  > http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany>has
>  > been edited by Luciano
>  > >  > Resende<
>  > http://cwiki.apache.org/confluence/display/%7Elresende@apache.org> (Apr
>  > >  > 22, 2008).
>  > >  >
>  > >  > (View changes)<
>  > http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6
>  > >
>  > >  > Content:
>  > >
>  > > > Build your first Web Services with Tuscany
>  > >  >
>  > >  > This guide will give you step by step instructions on how to build
>  > your
>  > >  > first web services.
>  > >  > The first part, we will learn how we can add the Tuscany Runtime to
>  > >  > Eclipse IDE.
>  > >  > The second part, will show how easy is to create a webservices using
>  > >  > Apache Tuscany.
>  > >
>  > > > Install Tuscany Eclipse Plugins 1.1
>  > >  > Install the Tuscany Eclipse Plugin
>  > >  >
>  > >  > The first thing you do is to start Eclipse and go to *Help ->
>  > Software
>  > >  > Updates -> Find and Install*,
>  > >  > select "Search for new features to install" and then click next
>  > >  >
>  > >  > On the next dialog, click on *"New Remote Site..."* to create a new
>  > site
>  > >  > entry. Give it a name such as
>  > >  > "Tuscany" and add the site URL as *
>  > >  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>  > <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>  > >  >
>  > >  > Make sure the *"Remote  Site"* that was just created is selected, and
>  > >  > click *"Finish"*
>  > >  >
>  > >  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*, and then,
>  > on
>  > >  > the next dialog, click *"Finish"*
>  > >  >
>  > >  > Accept the *"Plugin License"*
>  > >  >
>  > >  > and next click on *"Install All"*
>  > >  >
>  > >  > When asked to *"restart eclipse"*, click the  *"yes"* button.
>  > >  >
>  > >  > Create your Service Business Logic Create a Java Project
>  > >
>  > > >
>  > >  > In this step you create a Java Project in Eclipse to hold the
>  > composite
>  > >  > service application.
>  > >  > Click on the *New Java Project* button   in the toolbar to launch the
>  > >
>  > > > project creation dialog.
>  > >  > Next you enter "ws" as the *Project name*, and for *Project Layout*
>  > select
>  > >  > *Create separate*
>  > >  > *folders for sources and class files.*
>  > >
>  > > >
>  > >  >
>  > >  >
>  > >  >
>  > >  > Hit the *Next* button, and on the following page go to the
>  > *Libraries*tab. Use the
>  > >  > *Add Library...*
>  > >  > button on the right to add the *Tuscany Library* library to the
>  > project.
>  > >  >
>  > >  >
>  > >  >
>  > >  >
>  > >
>  > > > Hit the *Finish* button to complete the *New Java Project* dialog to
>  > >  > create the "ws" java project.
>  > >  >
>  > >  >
>  > >  >
>  > >  >
>  > >
>  > > > Construct Services
>  > >  >
>  > >  > First you create the "helloworld" package folders into which later in
>  > this
>  > >  > step you place service implementations.
>  > >  > Select the "ws" project and click on the *New Java Package* button in
>  > the
>  > >
>  > > > toolbar to launch
>  > >  > the package creation dialog.
>  > >  >
>  > >  > Next you enter "helloworld" as the package *Name*, and press the
>  > *Finish*button to complete the
>  > >  > dialog.
>  > >  >
>  > >  >
>  > >
>  > > > *HelloWorld*
>  > >  >
>  > >  > In this step you create the HelloWorld service interface and
>  > >  > implementation.
>  > >  > Select the "helloworld" package. Next you click on the dropdown arrow
>  > next
>  > >  > to the *New Java Class*
>  > >  > button    and select the *New Java Interface*    option from the
>  > dropdown
>  > >
>  > > > list. In the dialog
>  > >  > enter "HelloWorld" as the *Name* of the interface and select the
>  > Finish
>  > >  > button to complete the dialog.
>  > >  > The Java editor will open on the new created Java interface. Replace
>  > the
>  > >  > content of the editor by
>  > >  > *copy-paste* of the following Java interface code snippet.
>  > >  >
>  > >
>  > > > package helloworld;import org.osoa.sca.annotations.Remotable;
>  > >  > @Remotablepublic interface HelloWorld {
>  > >  >     String sayHello(String name);
>  > >  > }
>  > >  >
>  > >
>  > > >  Select the "helloworld" package again. Select the *New Java Class*
>  > button
>  > >
>  > > > . In the dialog enter
>  > >  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as the
>  > >  > interface this class implements, and
>  > >  > then select *Finish* to complete the dialog.
>  > >  >
>  > >  > The Java editor will open on the new created Java class. Replace the
>  > >  > content of the editor by
>  > >  > *copy-paste* of the following Java class code snippet.
>  > >  >
>  > >
>  > > > package helloworld;public class HelloWorldImpl implements HelloWorld {
>  > >  >       public String sayHello(String name) {
>  > >  >               return "Hello " + name;
>  > >  >       }
>  > >  > }
>  > >  >
>  > >
>  > > >  After completing these steps the content of the "ws" project will
>  > look as
>  > >  > follows.
>  > >  >
>  > >  >
>  > >
>  > > > Compose Services
>  > >  >
>  > >  > Now that you have all the required service implementations you
>  > compose
>  > >  > them together to provide
>  > >  > the store composite service. The composition is stored in a
>  > .composite
>  > >  > file.
>  > >  >
>  > >  > Select the "src" folder of the "ws" project. *Right click* to get the
>  > >  > context menu, select *New*, and
>  > >  > then *File*. In the *New File* dialog enter "helloworld.composite"
>  > for the
>  > >  > *File name*, and then select *Finish*
>  > >  > to complete the dialog.
>  > >  >
>  > >  > The Text editor will open on the new created composite file. Replace
>  > the
>  > >  > content of the editor by
>  > >  > *copy-paste* of the following composite snippet.
>  > >  >
>  > >
>  > > > <?xml version="1.0" encoding="UTF-8"?>
>  > >  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"
>  >         xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>  >       xmlns:c="http://helloworld"                     name="helloworld">
>  > >  >
>  > >  >
>  > >  >       <component name="HelloWorldComponent">
>  > >  >               <implementation.java
>  > class="helloworld.HelloWorldImpl"/>
>  > >  >               <service name="HelloWorld">
>  > >  >                       <binding.ws uri="
>  > http://localhost:8080/HelloWorld"/>            </service>
>  > >  >       </component>
>  > >  > </composite>
>  > >  >
>  > >
>  > > >  After completing these steps the content of the "store" project will
>  > look
>  > >  > as follows.
>  > >  >
>  > >  >
>  > >  >
>  > >  >
>  > >
>  > > > Congratulations you completed your 1st composite service applications,
>  > now
>  > >  > its time to take it into
>  > >  > action.
>  > >
>  > > > Use Services
>  > >  >
>  > >  > In this step you launch and use the ws composite service application
>  > you
>  > >  > created.
>  > >  >
>  > >  > First select the "helloworld.composite" file, in your "ws" project.
>  > *Right
>  > >  > click* to get the
>  > >  > context menu, select *Run As*, and then *Tuscany*. The Tuscany
>  > runtime
>  > >  > will start up adding
>  > >  > the helloworld composition to its domain and will make the helloworld
>  > web
>  > >  > service live.
>  > >  >
>  > >  > The Eclipse console will show the following messages.
>  > >  >
>  > >  >
>  > >  >
>  > >
>  > > >  Next Launch your Web browser and enter the following address:
>  > >  >
>  > >  > http://localhost:8080/HelloWorld?wsdl
>  > >  >
>  > >
>  > > > You should now have your web service live, and the url should give you
>  > >  > back a generated wsdl for the service.
>  > >  >
>  > >
>  > >
>  > > > <?xml version="1.0" encoding="UTF-8"?>
>  > >  > <wsdl:definitions targetNamespace="http://helloworld" xmlns:soap12="
>  > http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="http://helloworld"
>  > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
>  > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
>  > http://org.apache.axis2/xsd" xmlns:wsaw="
>  > http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="
>  > http://www.w3.org/2001/XMLSchema" xmlns:soap="
>  > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
>  > http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
>  > >  >     <xs:schema attributeFormDefault="qualified"
>  > elementFormDefault="qualified" targetNamespace="http://helloworld"
>  > xmlns:ns="http://helloworld">         <xs:element name="sayHello">
>  > >  >             <xs:complexType>
>  > >  >                <xs:sequence>
>  > >  >                   <xs:element minOccurs="0" name="param0"
>  > nillable="true" type="xs:string"/>
>  > >  >                </xs:sequence>
>  > >  >             </xs:complexType>
>  > >  >
>  > >  >          </xs:element>
>  > >  >          <xs:element name="sayHelloResponse">
>  > >  >             <xs:complexType>
>  > >  >                <xs:sequence>
>  > >  >                   <xs:element minOccurs="0" name="return"
>  > nillable="true" type="xs:string"/>
>  > >  >                </xs:sequence>
>  > >  >             </xs:complexType>
>  > >  >          </xs:element>
>  > >  >       </xs:schema>
>  > >  >
>  > >  >   </wsdl:types>
>  > >  >   <wsdl:message name="sayHelloRequest">
>  > >  >     <wsdl:part name="parameters" element="ns0:sayHello">
>  > >  >     </wsdl:part>
>  > >  >   </wsdl:message>
>  > >  >   <wsdl:message name="sayHelloResponse">
>  > >  >     <wsdl:part name="parameters" element="ns0:sayHelloResponse">
>  > >  >     </wsdl:part>
>  > >  >   </wsdl:message>
>  > >  >
>  > >  >   <wsdl:portType name="HelloWorldPortType">
>  > >  >     <wsdl:operation name="sayHello">
>  > >  >       <wsdl:input message="ns0:sayHelloRequest"
>  > wsaw:Action="urn:sayHello">
>  > >  >     </wsdl:input>
>  > >  >       <wsdl:output message="ns0:sayHelloResponse"
>  > wsaw:Action="urn:sayHelloResponse">
>  > >  >     </wsdl:output>
>  > >  >     </wsdl:operation>
>  > >  >   </wsdl:portType>
>  > >  >   <wsdl:binding name="HelloWorldHttpBinding"
>  > type="ns0:HelloWorldPortType">
>  > >  >
>  > >  >     <http:binding verb="POST"/>
>  > >  >     <wsdl:operation name="sayHello">
>  > >  >       <http:operation location="HelloWorld/sayHello"/>
>  > >  >       <wsdl:input>
>  > >  >         <mime:content part="sayHello" type="text/xml"/>
>  > >  >       </wsdl:input>
>  > >  >       <wsdl:output>
>  > >  >         <mime:content part="sayHello" type="text/xml"/>
>  > >  >       </wsdl:output>
>  > >  >
>  > >  >     </wsdl:operation>
>  > >  >   </wsdl:binding>
>  > >  >   <wsdl:binding name="HelloWorldSOAP11Binding"
>  > type="ns0:HelloWorldPortType">
>  > >  >     <soap:binding style="document" transport="
>  > http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation
>  > name="sayHello">
>  > >  >       <soap:operation soapAction="urn:sayHello" style="document"/>
>  > >  >       <wsdl:input>
>  > >  >         <soap:body use="literal"/>
>  > >  >       </wsdl:input>
>  > >  >
>  > >  >       <wsdl:output>
>  > >  >         <soap:body use="literal"/>
>  > >  >       </wsdl:output>
>  > >  >     </wsdl:operation>
>  > >  >   </wsdl:binding>
>  > >  >   <wsdl:service name="HelloWorld">
>  > >  >     <wsdl:port name="HelloWorldSOAP11port_http"
>  > binding="ns0:HelloWorldSOAP11Binding">
>  > >  >       <soap:address location="http://192.168.209.1:8080/HelloWorld"/>
>  >    </wsdl:port>
>  > >  >
>  > >  >     <wsdl:port name="HelloWorldHttpport"
>  > binding="ns0:HelloWorldHttpBinding">
>  > >  >       <http:address location="http://192.168.209.1:8080/HelloWorld"/>
>  >    </wsdl:port>
>  > >  >   </wsdl:service>
>  > >  > </wsdl:definitions>
>  > >  >
>  > >  >      Powered by Atlassian Confluence<
>  > http://www.atlassian.com/software/confluence/default.jsp?clicked=footer>(Version:
>  > 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
>  > >  > request <http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470
>  > >
>  > >
>  > >
>  > > >
>  > >  > Unsubscribe or edit your notifications preferences<
>  > http://cwiki.apache.org/confluence/users/viewnotifications.action>
>  > >  >
>  > >
>  >
>  >
>  >
>  > --
>  > Luciano Resende
>  > Apache Tuscany Committer
>  > http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
>  > http://lresende.blogspot.com/
>  >
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by ant elder <an...@gmail.com>.
I asked as I'd like to help expand it but don't want to step on your toes.
Adding web clients sounds good, expanding the WS bit with how to use other
databindings would be useful, maybe something on other bindings like JMS,
then it could go on with what to do when you want to run it out side of
eclipse - how to make contribution jars or run standalone or in webapps etc.
I like that that page is nice and simple and clear and focused so it would
be good to try to maintain that, maybe have separate pages for each topic
but linked together and in the same sort of style as that one. WDYT?

   ...ant

On Wed, Apr 23, 2008 at 5:17 PM, Luciano Resende <lu...@gmail.com>
wrote:

> Yes, it's on my todo list for the next couple days...
>
> Do you have any ideas for what type of extensions to use ? Maybe
> JSON-RPC and use a quick web2.0 client app to consume the service ?
>
> On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org> wrote:
> > This looks really good, do you have plans to extend it further like with
> >  adding clients or other extension types?
> >
> >    ...ant
> >
> >  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
> >
> >  >    Page Edited : TUSCANY<
> http://cwiki.apache.org/confluence/display/TUSCANY>: Build
> >  > your first Web Services with Tuscany<
> http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany
> >
> >  >
> >  > Build your first Web Services with Tuscany<
> http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany>has
> been edited by Luciano
> >  > Resende<
> http://cwiki.apache.org/confluence/display/%7Elresende@apache.org> (Apr
> >  > 22, 2008).
> >  >
> >  > (View changes)<
> http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6
> >
> >  > Content:
> >
> > > Build your first Web Services with Tuscany
> >  >
> >  > This guide will give you step by step instructions on how to build
> your
> >  > first web services.
> >  > The first part, we will learn how we can add the Tuscany Runtime to
> >  > Eclipse IDE.
> >  > The second part, will show how easy is to create a webservices using
> >  > Apache Tuscany.
> >
> > > Install Tuscany Eclipse Plugins 1.1
> >  > Install the Tuscany Eclipse Plugin
> >  >
> >  > The first thing you do is to start Eclipse and go to *Help ->
> Software
> >  > Updates -> Find and Install*,
> >  > select "Search for new features to install" and then click next
> >  >
> >  > On the next dialog, click on *"New Remote Site..."* to create a new
> site
> >  > entry. Give it a name such as
> >  > "Tuscany" and add the site URL as *
> >  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> <http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
> >  >
> >  > Make sure the *"Remote  Site"* that was just created is selected, and
> >  > click *"Finish"*
> >  >
> >  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*, and then,
> on
> >  > the next dialog, click *"Finish"*
> >  >
> >  > Accept the *"Plugin License"*
> >  >
> >  > and next click on *"Install All"*
> >  >
> >  > When asked to *"restart eclipse"*, click the  *"yes"* button.
> >  >
> >  > Create your Service Business Logic Create a Java Project
> >
> > >
> >  > In this step you create a Java Project in Eclipse to hold the
> composite
> >  > service application.
> >  > Click on the *New Java Project* button   in the toolbar to launch the
> >
> > > project creation dialog.
> >  > Next you enter "ws" as the *Project name*, and for *Project Layout*
> select
> >  > *Create separate*
> >  > *folders for sources and class files.*
> >
> > >
> >  >
> >  >
> >  >
> >  > Hit the *Next* button, and on the following page go to the
> *Libraries*tab. Use the
> >  > *Add Library...*
> >  > button on the right to add the *Tuscany Library* library to the
> project.
> >  >
> >  >
> >  >
> >  >
> >
> > > Hit the *Finish* button to complete the *New Java Project* dialog to
> >  > create the "ws" java project.
> >  >
> >  >
> >  >
> >  >
> >
> > > Construct Services
> >  >
> >  > First you create the "helloworld" package folders into which later in
> this
> >  > step you place service implementations.
> >  > Select the "ws" project and click on the *New Java Package* button in
> the
> >
> > > toolbar to launch
> >  > the package creation dialog.
> >  >
> >  > Next you enter "helloworld" as the package *Name*, and press the
> *Finish*button to complete the
> >  > dialog.
> >  >
> >  >
> >
> > > *HelloWorld*
> >  >
> >  > In this step you create the HelloWorld service interface and
> >  > implementation.
> >  > Select the "helloworld" package. Next you click on the dropdown arrow
> next
> >  > to the *New Java Class*
> >  > button    and select the *New Java Interface*    option from the
> dropdown
> >
> > > list. In the dialog
> >  > enter "HelloWorld" as the *Name* of the interface and select the
> Finish
> >  > button to complete the dialog.
> >  > The Java editor will open on the new created Java interface. Replace
> the
> >  > content of the editor by
> >  > *copy-paste* of the following Java interface code snippet.
> >  >
> >
> > > package helloworld;import org.osoa.sca.annotations.Remotable;
> >  > @Remotablepublic interface HelloWorld {
> >  >     String sayHello(String name);
> >  > }
> >  >
> >
> > >  Select the "helloworld" package again. Select the *New Java Class*
> button
> >
> > > . In the dialog enter
> >  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as the
> >  > interface this class implements, and
> >  > then select *Finish* to complete the dialog.
> >  >
> >  > The Java editor will open on the new created Java class. Replace the
> >  > content of the editor by
> >  > *copy-paste* of the following Java class code snippet.
> >  >
> >
> > > package helloworld;public class HelloWorldImpl implements HelloWorld {
> >  >       public String sayHello(String name) {
> >  >               return "Hello " + name;
> >  >       }
> >  > }
> >  >
> >
> > >  After completing these steps the content of the "ws" project will
> look as
> >  > follows.
> >  >
> >  >
> >
> > > Compose Services
> >  >
> >  > Now that you have all the required service implementations you
> compose
> >  > them together to provide
> >  > the store composite service. The composition is stored in a
> .composite
> >  > file.
> >  >
> >  > Select the "src" folder of the "ws" project. *Right click* to get the
> >  > context menu, select *New*, and
> >  > then *File*. In the *New File* dialog enter "helloworld.composite"
> for the
> >  > *File name*, and then select *Finish*
> >  > to complete the dialog.
> >  >
> >  > The Text editor will open on the new created composite file. Replace
> the
> >  > content of the editor by
> >  > *copy-paste* of the following composite snippet.
> >  >
> >
> > > <?xml version="1.0" encoding="UTF-8"?>
> >  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"
>         xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>       xmlns:c="http://helloworld"                     name="helloworld">
> >  >
> >  >
> >  >       <component name="HelloWorldComponent">
> >  >               <implementation.java
> class="helloworld.HelloWorldImpl"/>
> >  >               <service name="HelloWorld">
> >  >                       <binding.ws uri="
> http://localhost:8080/HelloWorld"/>            </service>
> >  >       </component>
> >  > </composite>
> >  >
> >
> > >  After completing these steps the content of the "store" project will
> look
> >  > as follows.
> >  >
> >  >
> >  >
> >  >
> >
> > > Congratulations you completed your 1st composite service applications,
> now
> >  > its time to take it into
> >  > action.
> >
> > > Use Services
> >  >
> >  > In this step you launch and use the ws composite service application
> you
> >  > created.
> >  >
> >  > First select the "helloworld.composite" file, in your "ws" project.
> *Right
> >  > click* to get the
> >  > context menu, select *Run As*, and then *Tuscany*. The Tuscany
> runtime
> >  > will start up adding
> >  > the helloworld composition to its domain and will make the helloworld
> web
> >  > service live.
> >  >
> >  > The Eclipse console will show the following messages.
> >  >
> >  >
> >  >
> >
> > >  Next Launch your Web browser and enter the following address:
> >  >
> >  > http://localhost:8080/HelloWorld?wsdl
> >  >
> >
> > > You should now have your web service live, and the url should give you
> >  > back a generated wsdl for the service.
> >  >
> >
> >
> > > <?xml version="1.0" encoding="UTF-8"?>
> >  > <wsdl:definitions targetNamespace="http://helloworld" xmlns:soap12="
> http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="http://helloworld"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
> http://org.apache.axis2/xsd" xmlns:wsaw="
> http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="
> http://www.w3.org/2001/XMLSchema" xmlns:soap="
> http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
> >  >     <xs:schema attributeFormDefault="qualified"
> elementFormDefault="qualified" targetNamespace="http://helloworld"
> xmlns:ns="http://helloworld">         <xs:element name="sayHello">
> >  >             <xs:complexType>
> >  >                <xs:sequence>
> >  >                   <xs:element minOccurs="0" name="param0"
> nillable="true" type="xs:string"/>
> >  >                </xs:sequence>
> >  >             </xs:complexType>
> >  >
> >  >          </xs:element>
> >  >          <xs:element name="sayHelloResponse">
> >  >             <xs:complexType>
> >  >                <xs:sequence>
> >  >                   <xs:element minOccurs="0" name="return"
> nillable="true" type="xs:string"/>
> >  >                </xs:sequence>
> >  >             </xs:complexType>
> >  >          </xs:element>
> >  >       </xs:schema>
> >  >
> >  >   </wsdl:types>
> >  >   <wsdl:message name="sayHelloRequest">
> >  >     <wsdl:part name="parameters" element="ns0:sayHello">
> >  >     </wsdl:part>
> >  >   </wsdl:message>
> >  >   <wsdl:message name="sayHelloResponse">
> >  >     <wsdl:part name="parameters" element="ns0:sayHelloResponse">
> >  >     </wsdl:part>
> >  >   </wsdl:message>
> >  >
> >  >   <wsdl:portType name="HelloWorldPortType">
> >  >     <wsdl:operation name="sayHello">
> >  >       <wsdl:input message="ns0:sayHelloRequest"
> wsaw:Action="urn:sayHello">
> >  >     </wsdl:input>
> >  >       <wsdl:output message="ns0:sayHelloResponse"
> wsaw:Action="urn:sayHelloResponse">
> >  >     </wsdl:output>
> >  >     </wsdl:operation>
> >  >   </wsdl:portType>
> >  >   <wsdl:binding name="HelloWorldHttpBinding"
> type="ns0:HelloWorldPortType">
> >  >
> >  >     <http:binding verb="POST"/>
> >  >     <wsdl:operation name="sayHello">
> >  >       <http:operation location="HelloWorld/sayHello"/>
> >  >       <wsdl:input>
> >  >         <mime:content part="sayHello" type="text/xml"/>
> >  >       </wsdl:input>
> >  >       <wsdl:output>
> >  >         <mime:content part="sayHello" type="text/xml"/>
> >  >       </wsdl:output>
> >  >
> >  >     </wsdl:operation>
> >  >   </wsdl:binding>
> >  >   <wsdl:binding name="HelloWorldSOAP11Binding"
> type="ns0:HelloWorldPortType">
> >  >     <soap:binding style="document" transport="
> http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation
> name="sayHello">
> >  >       <soap:operation soapAction="urn:sayHello" style="document"/>
> >  >       <wsdl:input>
> >  >         <soap:body use="literal"/>
> >  >       </wsdl:input>
> >  >
> >  >       <wsdl:output>
> >  >         <soap:body use="literal"/>
> >  >       </wsdl:output>
> >  >     </wsdl:operation>
> >  >   </wsdl:binding>
> >  >   <wsdl:service name="HelloWorld">
> >  >     <wsdl:port name="HelloWorldSOAP11port_http"
> binding="ns0:HelloWorldSOAP11Binding">
> >  >       <soap:address location="http://192.168.209.1:8080/HelloWorld"/>
>    </wsdl:port>
> >  >
> >  >     <wsdl:port name="HelloWorldHttpport"
> binding="ns0:HelloWorldHttpBinding">
> >  >       <http:address location="http://192.168.209.1:8080/HelloWorld"/>
>    </wsdl:port>
> >  >   </wsdl:service>
> >  > </wsdl:definitions>
> >  >
> >  >      Powered by Atlassian Confluence<
> http://www.atlassian.com/software/confluence/default.jsp?clicked=footer>(Version:
> 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
> >  > request <http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470
> >
> >
> >
> > >
> >  > Unsubscribe or edit your notifications preferences<
> http://cwiki.apache.org/confluence/users/viewnotifications.action>
> >  >
> >
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>

Re: [CONF] Apache Tuscany: Build your first Web Services with Tuscany (page edited)

Posted by Luciano Resende <lu...@gmail.com>.
Yes, it's on my todo list for the next couple days...

Do you have any ideas for what type of extensions to use ? Maybe
JSON-RPC and use a quick web2.0 client app to consume the service ?

On Wed, Apr 23, 2008 at 4:39 AM, ant elder <an...@apache.org> wrote:
> This looks really good, do you have plans to extend it further like with
>  adding clients or other extension types?
>
>    ...ant
>
>  On Tue, Apr 22, 2008 at 5:53 PM, <co...@apache.org> wrote:
>
>  >    Page Edited : TUSCANY<http://cwiki.apache.org/confluence/display/TUSCANY>: Build
>  > your first Web Services with Tuscany<http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany>
>  >
>  > Build your first Web Services with Tuscany<http://cwiki.apache.org/confluence/display/TUSCANY/Build+your+first+Web+Services+with+Tuscany>has been edited by Luciano
>  > Resende<ht...@apache.org> (Apr
>  > 22, 2008).
>  >
>  > (View changes)<http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=82971&originalVersion=5&revisedVersion=6>
>  > Content:
>
> > Build your first Web Services with Tuscany
>  >
>  > This guide will give you step by step instructions on how to build your
>  > first web services.
>  > The first part, we will learn how we can add the Tuscany Runtime to
>  > Eclipse IDE.
>  > The second part, will show how easy is to create a webservices using
>  > Apache Tuscany.
>
> > Install Tuscany Eclipse Plugins 1.1
>  > Install the Tuscany Eclipse Plugin
>  >
>  > The first thing you do is to start Eclipse and go to *Help -> Software
>  > Updates -> Find and Install*,
>  > select "Search for new features to install" and then click next
>  >
>  > On the next dialog, click on *"New Remote Site..."* to create a new site
>  > entry. Give it a name such as
>  > "Tuscany" and add the site URL as *
>  > http://people.apache.org/~jsdelfino/tuscany/tools/updatesite/*<http://people.apache.org/%7Ejsdelfino/tuscany/tools/updatesite/*>
>  >
>  > Make sure the *"Remote  Site"* that was just created is selected, and
>  > click *"Finish"*
>  >
>  > Select the *"Apache Tuscany SCA Tools"* and click *"Next"*, and then, on
>  > the next dialog, click *"Finish"*
>  >
>  > Accept the *"Plugin License"*
>  >
>  > and next click on *"Install All"*
>  >
>  > When asked to *"restart eclipse"*, click the  *"yes"* button.
>  >
>  > Create your Service Business Logic Create a Java Project
>
> >
>  > In this step you create a Java Project in Eclipse to hold the composite
>  > service application.
>  > Click on the *New Java Project* button   in the toolbar to launch the
>
> > project creation dialog.
>  > Next you enter "ws" as the *Project name*, and for *Project Layout* select
>  > *Create separate*
>  > *folders for sources and class files.*
>
> >
>  >
>  >
>  >
>  > Hit the *Next* button, and on the following page go to the *Libraries*tab. Use the
>  > *Add Library...*
>  > button on the right to add the *Tuscany Library* library to the project.
>  >
>  >
>  >
>  >
>
> > Hit the *Finish* button to complete the *New Java Project* dialog to
>  > create the "ws" java project.
>  >
>  >
>  >
>  >
>
> > Construct Services
>  >
>  > First you create the "helloworld" package folders into which later in this
>  > step you place service implementations.
>  > Select the "ws" project and click on the *New Java Package* button in the
>
> > toolbar to launch
>  > the package creation dialog.
>  >
>  > Next you enter "helloworld" as the package *Name*, and press the *Finish*button to complete the
>  > dialog.
>  >
>  >
>
> > *HelloWorld*
>  >
>  > In this step you create the HelloWorld service interface and
>  > implementation.
>  > Select the "helloworld" package. Next you click on the dropdown arrow next
>  > to the *New Java Class*
>  > button    and select the *New Java Interface*    option from the dropdown
>
> > list. In the dialog
>  > enter "HelloWorld" as the *Name* of the interface and select the Finish
>  > button to complete the dialog.
>  > The Java editor will open on the new created Java interface. Replace the
>  > content of the editor by
>  > *copy-paste* of the following Java interface code snippet.
>  >
>
> > package helloworld;import org.osoa.sca.annotations.Remotable;
>  > @Remotablepublic interface HelloWorld {
>  >     String sayHello(String name);
>  > }
>  >
>
> >  Select the "helloworld" package again. Select the *New Java Class* button
>
> > . In the dialog enter
>  > "HelloWorldImpl" as the *Name* of the class, add "Catalog" as the
>  > interface this class implements, and
>  > then select *Finish* to complete the dialog.
>  >
>  > The Java editor will open on the new created Java class. Replace the
>  > content of the editor by
>  > *copy-paste* of the following Java class code snippet.
>  >
>
> > package helloworld;public class HelloWorldImpl implements HelloWorld {
>  >       public String sayHello(String name) {
>  >               return "Hello " + name;
>  >       }
>  > }
>  >
>
> >  After completing these steps the content of the "ws" project will look as
>  > follows.
>  >
>  >
>
> > Compose Services
>  >
>  > Now that you have all the required service implementations you compose
>  > them together to provide
>  > the store composite service. The composition is stored in a .composite
>  > file.
>  >
>  > Select the "src" folder of the "ws" project. *Right click* to get the
>  > context menu, select *New*, and
>  > then *File*. In the *New File* dialog enter "helloworld.composite" for the
>  > *File name*, and then select *Finish*
>  > to complete the dialog.
>  >
>  > The Text editor will open on the new created composite file. Replace the
>  > content of the editor by
>  > *copy-paste* of the following composite snippet.
>  >
>
> > <?xml version="1.0" encoding="UTF-8"?>
>  > <composite    xmlns="http://www.osoa.org/xmlns/sca/1.0"                       xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"                       xmlns:c="http://helloworld"                     name="helloworld">
>  >
>  >
>  >       <component name="HelloWorldComponent">
>  >               <implementation.java class="helloworld.HelloWorldImpl"/>
>  >               <service name="HelloWorld">
>  >                       <binding.ws uri="http://localhost:8080/HelloWorld"/>            </service>
>  >       </component>
>  > </composite>
>  >
>
> >  After completing these steps the content of the "store" project will look
>  > as follows.
>  >
>  >
>  >
>  >
>
> > Congratulations you completed your 1st composite service applications, now
>  > its time to take it into
>  > action.
>
> > Use Services
>  >
>  > In this step you launch and use the ws composite service application you
>  > created.
>  >
>  > First select the "helloworld.composite" file, in your "ws" project. *Right
>  > click* to get the
>  > context menu, select *Run As*, and then *Tuscany*. The Tuscany runtime
>  > will start up adding
>  > the helloworld composition to its domain and will make the helloworld web
>  > service live.
>  >
>  > The Eclipse console will show the following messages.
>  >
>  >
>  >
>
> >  Next Launch your Web browser and enter the following address:
>  >
>  > http://localhost:8080/HelloWorld?wsdl
>  >
>
> > You should now have your web service live, and the url should give you
>  > back a generated wsdl for the service.
>  >
>
>
> > <?xml version="1.0" encoding="UTF-8"?>
>  > <wsdl:definitions targetNamespace="http://helloworld" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns0="http://helloworld" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">  <wsdl:types>
>  >     <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns:ns="http://helloworld">         <xs:element name="sayHello">
>  >             <xs:complexType>
>  >                <xs:sequence>
>  >                   <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/>
>  >                </xs:sequence>
>  >             </xs:complexType>
>  >
>  >          </xs:element>
>  >          <xs:element name="sayHelloResponse">
>  >             <xs:complexType>
>  >                <xs:sequence>
>  >                   <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
>  >                </xs:sequence>
>  >             </xs:complexType>
>  >          </xs:element>
>  >       </xs:schema>
>  >
>  >   </wsdl:types>
>  >   <wsdl:message name="sayHelloRequest">
>  >     <wsdl:part name="parameters" element="ns0:sayHello">
>  >     </wsdl:part>
>  >   </wsdl:message>
>  >   <wsdl:message name="sayHelloResponse">
>  >     <wsdl:part name="parameters" element="ns0:sayHelloResponse">
>  >     </wsdl:part>
>  >   </wsdl:message>
>  >
>  >   <wsdl:portType name="HelloWorldPortType">
>  >     <wsdl:operation name="sayHello">
>  >       <wsdl:input message="ns0:sayHelloRequest" wsaw:Action="urn:sayHello">
>  >     </wsdl:input>
>  >       <wsdl:output message="ns0:sayHelloResponse" wsaw:Action="urn:sayHelloResponse">
>  >     </wsdl:output>
>  >     </wsdl:operation>
>  >   </wsdl:portType>
>  >   <wsdl:binding name="HelloWorldHttpBinding" type="ns0:HelloWorldPortType">
>  >
>  >     <http:binding verb="POST"/>
>  >     <wsdl:operation name="sayHello">
>  >       <http:operation location="HelloWorld/sayHello"/>
>  >       <wsdl:input>
>  >         <mime:content part="sayHello" type="text/xml"/>
>  >       </wsdl:input>
>  >       <wsdl:output>
>  >         <mime:content part="sayHello" type="text/xml"/>
>  >       </wsdl:output>
>  >
>  >     </wsdl:operation>
>  >   </wsdl:binding>
>  >   <wsdl:binding name="HelloWorldSOAP11Binding" type="ns0:HelloWorldPortType">
>  >     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation name="sayHello">
>  >       <soap:operation soapAction="urn:sayHello" style="document"/>
>  >       <wsdl:input>
>  >         <soap:body use="literal"/>
>  >       </wsdl:input>
>  >
>  >       <wsdl:output>
>  >         <soap:body use="literal"/>
>  >       </wsdl:output>
>  >     </wsdl:operation>
>  >   </wsdl:binding>
>  >   <wsdl:service name="HelloWorld">
>  >     <wsdl:port name="HelloWorldSOAP11port_http" binding="ns0:HelloWorldSOAP11Binding">
>  >       <soap:address location="http://192.168.209.1:8080/HelloWorld"/>    </wsdl:port>
>  >
>  >     <wsdl:port name="HelloWorldHttpport" binding="ns0:HelloWorldHttpBinding">
>  >       <http:address location="http://192.168.209.1:8080/HelloWorld"/>    </wsdl:port>
>  >   </wsdl:service>
>  > </wsdl:definitions>
>  >
>  >      Powered by Atlassian Confluence<http://www.atlassian.com/software/confluence/default.jsp?clicked=footer>(Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
>  > request <http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470>
>
>
> >
>  > Unsubscribe or edit your notifications preferences<http://cwiki.apache.org/confluence/users/viewnotifications.action>
>  >
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/