You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Danny Lin <Li...@doc.state.sc.us> on 2006/12/22 21:48:08 UTC

Axis2 - schema and WSDL

We are limited to use a pre-defined schema to create a web service. I
have the schema as well as an sample XML document. What should I do next
to create a web service in Axis2? I've read through all the sample codes
but I couldn't find one that directs me from this path of development.
Do I need to manually create a WSDL from this schema then use the
wsdl2java tool to generate a stub?
 
Thanks.
 

Re: Axis2 - schema and WSDL

Posted by Thilina Gunarathne <cs...@gmail.com>.
Ooops... Apologies for the acronyms..

DII - Dynamic Invocation Interface... In simpler words it's the
Service Client and the OperationClient...

~Thilina

On 12/26/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> Thilina, thank you for writing. I have a "dumb" question. What is DII
> API? I can't seem to find it in the document. Thank you again.
>
> Danny
>
>
> -----Original Message-----
> From: Thilina Gunarathne [mailto:csethil@gmail.com]
> Sent: Monday, December 25, 2006 11:35 PM
> To: axis-user@ws.apache.org
> Subject: Re: Axis2 - schema and WSDL
>
> Srinath had this[1] blog entry some time back which contains the use of
> XMLBeans generated code with the Axis 2 DII api...  Seems like it is
> addresses your problem..
>
> Also have a look at the databinding sample which comes with Axis2..
> (Axis2/modules/samples/databinding).. It's bit more complex than the
> above and shows how users can plug in data binding frameworks easily..
>
> Thanks,
> Thilina
>
> [1]http://www.bloglines.com/blog/hemapani?id=99
>
> On 12/24/06, Ajith Ranabahu <aj...@gmail.com> wrote:
> > Hi,
> > XMLBeans can compile the schema into a set of classes that maps a
> > schema to a class and also includes the code to convert a instance XML
>
> > to an object instance (vice versa). This is what we call databinding
> > However when you want to build a service it needs the plumbing code to
>
> > get the XML message from the SOAP framework and do all the things that
>
> > is specific to your framework. This code cannot be generated just by
> > looking at the schema!. That is why you need the WSDL. This way of
> > writing services is known as the 'contract first' and since you have
> > the schema I think contract first way is the right way for you
> >
> > Ajith
> >
> > On 12/23/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> > > Thank you, Ajith, for responding. I am very new to Web Services and
> > > Axis2. I was doing some reading yesterday and found out that
> > > XMLBeans has utility to convert XSD to Java. If I generate Java code
>
> > > with XMLBeans, will I be able to produce correct web service message
>
> > > that's in compliance with the schema I give? Or, I still need to
> > > have WSDL in order to make it to work?
> > >
> > > Thanks again.
> > >
> > > Danny
> > >
> > >
> > > -----Original Message-----
> > > From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com]
> > > Sent: Friday, December 22, 2006 7:32 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: Axis2 - schema and WSDL
> > >
> > > Hi,
> > > Yes - right now the tools available in Axis2 does not let you
> > > directly convert a schema into a web service so you will have to
> > > make a WSDL document that uses that schema. However making a doc/lit
>
> > > WSDL using your schema is quite simple and straight forward. I have
> > > included a simple format you can follow
> > >
> > > <definitions targetNamespace="xx' xmlns:tns="xx">
> > >    <!-- don't forget the other namespaces in the parent !! -->
> > >     <types>
> > >       <schema>
> > >          <!-- import your schema here -->
> > >       </schema>
> > >     </types>
> > >    <!-- define two messages - one for input and one for output
> > >          the names really does not matter since they are only used
> > >          for reference -->
> > >    <message name="input">
> > >         <part element="yourInputMessageElement" name="part1"/>
> > >     </message>
> > >     <message name="output">
> > >         <part element="yourInputMessageElement" name="part1"/>
> > >     </message>
> > >
> > >     <portType name="YourPorttypeName">
> > >         <operation name="yourOperationName">
> > >             <input message="tns:input" name="in"/>
> > >             <output message="tns:output" name="out"/>
> > >         </operation>
> > >     </portType>
> > >
> > >   <binding name="yourBinding"
> > >         type="tns:YourPorttypeName">
> > >         <soap:binding style="document"
> > > transport="http://schemas.xmlsoap.org/soap/http"/>
> > >         <operation name="yourOperationName">
> > >             <soap:operation soapAction="http://soapinterop.org/"
> > > style="document"/>
> > >             <input name="in">
> > >                 <soap:body  use="literal"/>
> > >             </input>
> > >             <output name="out">
> > >                 <soap:body  use="literal"/>
> > >             </output>
> > >         </operation>
> > >    </binding>
> > >
> > >     <service name="yourServiceName">
> > >         <port binding="tns:yourBinding"
> > >             name="yourPort">
> > >             <soap:address
> > >                 location="http://some-dummy-address"/>
> > >         </port>
> > >     </service>
> > > </definitions>
> > >
> > > Note that the names of the portTypes bindings etc can be anything
> > > but the generated classes do reflect them. Say the generated java
> > > classs will contain the methods with the operation names.
> > >
> > > HTH
> > > Ajith
> > >
> > > On 12/22/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> > > >
> > > >
> > > > We are limited to use a pre-defined schema to create a web
> > > > service. I have the schema as well as an sample XML document. What
>
> > > > should I do next to create a web service in Axis2? I've read
> > > > through all the sample codes but I couldn't find one that directs
> > > > me from this path of
> > >
> > > > development. Do I need to manually create a WSDL from this schema
> > > > then
> > >
> > > > use the wsdl2java tool to generate a stub?
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> > > --
> > > Ajith Ranabahu
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Ajith Ranabahu
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Thilina Gunarathne
> WSO2, Inc.; http://www.wso2.com/
> Home page: http://webservices.apache.org/~thilina/
> Blog: http://thilinag.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Wsdl2java ant task many namespaceToPackages

Posted by Mehar SVLN <me...@gmail.com>.
try this out
namespaceToPackages="http://webservices.swa.src/xsd/=swa.webservices.xsd<http://webservices.swa.src/xsd=swa.webservices.xsd>
,
http://persistence.swa.src/xsd/=swa.persistence.xsd=swa.persistence.xsd<http://persistence.swa.src/xsd=swa.persistence.xsd=swa.persistence.xsd>
"

this works for me fine

Rgds
Mehar
On 12/26/06, Thomas Bruckmayer <br...@gmail.com> wrote:
>
> Hi all!
>
> Sorry for the question but i have to map more than one Namespace to a
> package, for example:
> namespaceToPackages="http://webservices.swa.src/xsd=swa.webservices.xsd,
> http://persistence.swa.src/xsd=swa.persistence.xsd=swa.persistence.xsd"
>
> But the above notation does not work, can pls somebody tell me how i add
> aditional namespaceToPackages?
>
> regards
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Rgds
Mehar

Wsdl2java ant task many namespaceToPackages

Posted by Thomas Bruckmayer <br...@gmail.com>.
Hi all!

Sorry for the question but i have to map more than one Namespace to a
package, for example:
namespaceToPackages="http://webservices.swa.src/xsd=swa.webservices.xsd,
http://persistence.swa.src/xsd=swa.persistence.xsd=swa.persistence.xsd"

But the above notation does not work, can pls somebody tell me how i add
aditional namespaceToPackages?

regards


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Axis2 - schema and WSDL

Posted by Danny Lin <Li...@doc.state.sc.us>.
Thilina, thank you for writing. I have a "dumb" question. What is DII
API? I can't seem to find it in the document. Thank you again.

Danny
 

-----Original Message-----
From: Thilina Gunarathne [mailto:csethil@gmail.com] 
Sent: Monday, December 25, 2006 11:35 PM
To: axis-user@ws.apache.org
Subject: Re: Axis2 - schema and WSDL

Srinath had this[1] blog entry some time back which contains the use of
XMLBeans generated code with the Axis 2 DII api...  Seems like it is
addresses your problem..

Also have a look at the databinding sample which comes with Axis2..
(Axis2/modules/samples/databinding).. It's bit more complex than the
above and shows how users can plug in data binding frameworks easily..

Thanks,
Thilina

[1]http://www.bloglines.com/blog/hemapani?id=99

On 12/24/06, Ajith Ranabahu <aj...@gmail.com> wrote:
> Hi,
> XMLBeans can compile the schema into a set of classes that maps a 
> schema to a class and also includes the code to convert a instance XML

> to an object instance (vice versa). This is what we call databinding 
> However when you want to build a service it needs the plumbing code to

> get the XML message from the SOAP framework and do all the things that

> is specific to your framework. This code cannot be generated just by 
> looking at the schema!. That is why you need the WSDL. This way of 
> writing services is known as the 'contract first' and since you have 
> the schema I think contract first way is the right way for you
>
> Ajith
>
> On 12/23/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> > Thank you, Ajith, for responding. I am very new to Web Services and 
> > Axis2. I was doing some reading yesterday and found out that 
> > XMLBeans has utility to convert XSD to Java. If I generate Java code

> > with XMLBeans, will I be able to produce correct web service message

> > that's in compliance with the schema I give? Or, I still need to 
> > have WSDL in order to make it to work?
> >
> > Thanks again.
> >
> > Danny
> >
> >
> > -----Original Message-----
> > From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com]
> > Sent: Friday, December 22, 2006 7:32 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: Axis2 - schema and WSDL
> >
> > Hi,
> > Yes - right now the tools available in Axis2 does not let you 
> > directly convert a schema into a web service so you will have to 
> > make a WSDL document that uses that schema. However making a doc/lit

> > WSDL using your schema is quite simple and straight forward. I have 
> > included a simple format you can follow
> >
> > <definitions targetNamespace="xx' xmlns:tns="xx">
> >    <!-- don't forget the other namespaces in the parent !! -->
> >     <types>
> >       <schema>
> >          <!-- import your schema here -->
> >       </schema>
> >     </types>
> >    <!-- define two messages - one for input and one for output
> >          the names really does not matter since they are only used
> >          for reference -->
> >    <message name="input">
> >         <part element="yourInputMessageElement" name="part1"/>
> >     </message>
> >     <message name="output">
> >         <part element="yourInputMessageElement" name="part1"/>
> >     </message>
> >
> >     <portType name="YourPorttypeName">
> >         <operation name="yourOperationName">
> >             <input message="tns:input" name="in"/>
> >             <output message="tns:output" name="out"/>
> >         </operation>
> >     </portType>
> >
> >   <binding name="yourBinding"
> >         type="tns:YourPorttypeName">
> >         <soap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> >         <operation name="yourOperationName">
> >             <soap:operation soapAction="http://soapinterop.org/"
> > style="document"/>
> >             <input name="in">
> >                 <soap:body  use="literal"/>
> >             </input>
> >             <output name="out">
> >                 <soap:body  use="literal"/>
> >             </output>
> >         </operation>
> >    </binding>
> >
> >     <service name="yourServiceName">
> >         <port binding="tns:yourBinding"
> >             name="yourPort">
> >             <soap:address
> >                 location="http://some-dummy-address"/>
> >         </port>
> >     </service>
> > </definitions>
> >
> > Note that the names of the portTypes bindings etc can be anything 
> > but the generated classes do reflect them. Say the generated java 
> > classs will contain the methods with the operation names.
> >
> > HTH
> > Ajith
> >
> > On 12/22/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> > >
> > >
> > > We are limited to use a pre-defined schema to create a web 
> > > service. I have the schema as well as an sample XML document. What

> > > should I do next to create a web service in Axis2? I've read 
> > > through all the sample codes but I couldn't find one that directs 
> > > me from this path of
> >
> > > development. Do I need to manually create a WSDL from this schema 
> > > then
> >
> > > use the wsdl2java tool to generate a stub?
> > >
> > > Thanks.
> > >
> >
> >
> > --
> > Ajith Ranabahu
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Ajith Ranabahu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


--
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 - schema and WSDL

Posted by Thilina Gunarathne <cs...@gmail.com>.
Srinath had this[1] blog entry some time back which contains the use
of XMLBeans generated code with the Axis 2 DII api...  Seems like it
is addresses your problem..

Also have a look at the databinding sample which comes with Axis2..
(Axis2/modules/samples/databinding).. It's bit more complex than the
above and shows how users can plug in data binding frameworks easily..

Thanks,
Thilina

[1]http://www.bloglines.com/blog/hemapani?id=99

On 12/24/06, Ajith Ranabahu <aj...@gmail.com> wrote:
> Hi,
> XMLBeans can compile the schema into a set of classes that maps a
> schema to a class and also includes the code to convert a instance XML
> to an object instance (vice versa). This is what we call databinding
> However when you want to build a service it needs the plumbing code to
> get the XML message from the SOAP framework and do all the things that
> is specific to your framework. This code cannot be generated just by
> looking at the schema!. That is why you need the WSDL. This way of
> writing services is known as the 'contract first' and since you have
> the schema I think contract first way is the right way for you
>
> Ajith
>
> On 12/23/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> > Thank you, Ajith, for responding. I am very new to Web Services and
> > Axis2. I was doing some reading yesterday and found out that XMLBeans
> > has utility to convert XSD to Java. If I generate Java code with
> > XMLBeans, will I be able to produce correct web service message that's
> > in compliance with the schema I give? Or, I still need to have WSDL in
> > order to make it to work?
> >
> > Thanks again.
> >
> > Danny
> >
> >
> > -----Original Message-----
> > From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com]
> > Sent: Friday, December 22, 2006 7:32 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: Axis2 - schema and WSDL
> >
> > Hi,
> > Yes - right now the tools available in Axis2 does not let you directly
> > convert a schema into a web service so you will have to make a WSDL
> > document that uses that schema. However making a doc/lit WSDL using your
> > schema is quite simple and straight forward. I have included a simple
> > format you can follow
> >
> > <definitions targetNamespace="xx' xmlns:tns="xx">
> >    <!-- don't forget the other namespaces in the parent !! -->
> >     <types>
> >       <schema>
> >          <!-- import your schema here -->
> >       </schema>
> >     </types>
> >    <!-- define two messages - one for input and one for output
> >          the names really does not matter since they are only used
> >          for reference -->
> >    <message name="input">
> >         <part element="yourInputMessageElement" name="part1"/>
> >     </message>
> >     <message name="output">
> >         <part element="yourInputMessageElement" name="part1"/>
> >     </message>
> >
> >     <portType name="YourPorttypeName">
> >         <operation name="yourOperationName">
> >             <input message="tns:input" name="in"/>
> >             <output message="tns:output" name="out"/>
> >         </operation>
> >     </portType>
> >
> >   <binding name="yourBinding"
> >         type="tns:YourPorttypeName">
> >         <soap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> >         <operation name="yourOperationName">
> >             <soap:operation soapAction="http://soapinterop.org/"
> > style="document"/>
> >             <input name="in">
> >                 <soap:body  use="literal"/>
> >             </input>
> >             <output name="out">
> >                 <soap:body  use="literal"/>
> >             </output>
> >         </operation>
> >    </binding>
> >
> >     <service name="yourServiceName">
> >         <port binding="tns:yourBinding"
> >             name="yourPort">
> >             <soap:address
> >                 location="http://some-dummy-address"/>
> >         </port>
> >     </service>
> > </definitions>
> >
> > Note that the names of the portTypes bindings etc can be anything but
> > the generated classes do reflect them. Say the generated java classs
> > will contain the methods with the operation names.
> >
> > HTH
> > Ajith
> >
> > On 12/22/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> > >
> > >
> > > We are limited to use a pre-defined schema to create a web service. I
> > > have the schema as well as an sample XML document. What should I do
> > > next to create a web service in Axis2? I've read through all the
> > > sample codes but I couldn't find one that directs me from this path of
> >
> > > development. Do I need to manually create a WSDL from this schema then
> >
> > > use the wsdl2java tool to generate a stub?
> > >
> > > Thanks.
> > >
> >
> >
> > --
> > Ajith Ranabahu
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Ajith Ranabahu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 - schema and WSDL

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
XMLBeans can compile the schema into a set of classes that maps a
schema to a class and also includes the code to convert a instance XML
to an object instance (vice versa). This is what we call databinding
However when you want to build a service it needs the plumbing code to
get the XML message from the SOAP framework and do all the things that
is specific to your framework. This code cannot be generated just by
looking at the schema!. That is why you need the WSDL. This way of
writing services is known as the 'contract first' and since you have
the schema I think contract first way is the right way for you

Ajith

On 12/23/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> Thank you, Ajith, for responding. I am very new to Web Services and
> Axis2. I was doing some reading yesterday and found out that XMLBeans
> has utility to convert XSD to Java. If I generate Java code with
> XMLBeans, will I be able to produce correct web service message that's
> in compliance with the schema I give? Or, I still need to have WSDL in
> order to make it to work?
>
> Thanks again.
>
> Danny
>
>
> -----Original Message-----
> From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com]
> Sent: Friday, December 22, 2006 7:32 PM
> To: axis-user@ws.apache.org
> Subject: Re: Axis2 - schema and WSDL
>
> Hi,
> Yes - right now the tools available in Axis2 does not let you directly
> convert a schema into a web service so you will have to make a WSDL
> document that uses that schema. However making a doc/lit WSDL using your
> schema is quite simple and straight forward. I have included a simple
> format you can follow
>
> <definitions targetNamespace="xx' xmlns:tns="xx">
>    <!-- don't forget the other namespaces in the parent !! -->
>     <types>
>       <schema>
>          <!-- import your schema here -->
>       </schema>
>     </types>
>    <!-- define two messages - one for input and one for output
>          the names really does not matter since they are only used
>          for reference -->
>    <message name="input">
>         <part element="yourInputMessageElement" name="part1"/>
>     </message>
>     <message name="output">
>         <part element="yourInputMessageElement" name="part1"/>
>     </message>
>
>     <portType name="YourPorttypeName">
>         <operation name="yourOperationName">
>             <input message="tns:input" name="in"/>
>             <output message="tns:output" name="out"/>
>         </operation>
>     </portType>
>
>   <binding name="yourBinding"
>         type="tns:YourPorttypeName">
>         <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>         <operation name="yourOperationName">
>             <soap:operation soapAction="http://soapinterop.org/"
> style="document"/>
>             <input name="in">
>                 <soap:body  use="literal"/>
>             </input>
>             <output name="out">
>                 <soap:body  use="literal"/>
>             </output>
>         </operation>
>    </binding>
>
>     <service name="yourServiceName">
>         <port binding="tns:yourBinding"
>             name="yourPort">
>             <soap:address
>                 location="http://some-dummy-address"/>
>         </port>
>     </service>
> </definitions>
>
> Note that the names of the portTypes bindings etc can be anything but
> the generated classes do reflect them. Say the generated java classs
> will contain the methods with the operation names.
>
> HTH
> Ajith
>
> On 12/22/06, Danny Lin <Li...@doc.state.sc.us> wrote:
> >
> >
> > We are limited to use a pre-defined schema to create a web service. I
> > have the schema as well as an sample XML document. What should I do
> > next to create a web service in Axis2? I've read through all the
> > sample codes but I couldn't find one that directs me from this path of
>
> > development. Do I need to manually create a WSDL from this schema then
>
> > use the wsdl2java tool to generate a stub?
> >
> > Thanks.
> >
>
>
> --
> Ajith Ranabahu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Axis2 - schema and WSDL

Posted by Danny Lin <Li...@doc.state.sc.us>.
Thank you, Ajith, for responding. I am very new to Web Services and
Axis2. I was doing some reading yesterday and found out that XMLBeans
has utility to convert XSD to Java. If I generate Java code with
XMLBeans, will I be able to produce correct web service message that's
in compliance with the schema I give? Or, I still need to have WSDL in
order to make it to work?

Thanks again.

Danny


-----Original Message-----
From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com] 
Sent: Friday, December 22, 2006 7:32 PM
To: axis-user@ws.apache.org
Subject: Re: Axis2 - schema and WSDL

Hi,
Yes - right now the tools available in Axis2 does not let you directly
convert a schema into a web service so you will have to make a WSDL
document that uses that schema. However making a doc/lit WSDL using your
schema is quite simple and straight forward. I have included a simple
format you can follow

<definitions targetNamespace="xx' xmlns:tns="xx">
   <!-- don't forget the other namespaces in the parent !! -->
    <types>
      <schema>
         <!-- import your schema here -->
      </schema>
    </types>
   <!-- define two messages - one for input and one for output
         the names really does not matter since they are only used
         for reference -->
   <message name="input">
        <part element="yourInputMessageElement" name="part1"/>
    </message>
    <message name="output">
        <part element="yourInputMessageElement" name="part1"/>
    </message>

    <portType name="YourPorttypeName">
        <operation name="yourOperationName">
            <input message="tns:input" name="in"/>
            <output message="tns:output" name="out"/>
        </operation>
    </portType>

  <binding name="yourBinding"
        type="tns:YourPorttypeName">
        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="yourOperationName">
            <soap:operation soapAction="http://soapinterop.org/"
style="document"/>
            <input name="in">
                <soap:body  use="literal"/>
            </input>
            <output name="out">
                <soap:body  use="literal"/>
            </output>
        </operation>
   </binding>

    <service name="yourServiceName">
        <port binding="tns:yourBinding"
            name="yourPort">
            <soap:address
                location="http://some-dummy-address"/>
        </port>
    </service>
</definitions>

Note that the names of the portTypes bindings etc can be anything but
the generated classes do reflect them. Say the generated java classs
will contain the methods with the operation names.

HTH
Ajith

On 12/22/06, Danny Lin <Li...@doc.state.sc.us> wrote:
>
>
> We are limited to use a pre-defined schema to create a web service. I 
> have the schema as well as an sample XML document. What should I do 
> next to create a web service in Axis2? I've read through all the 
> sample codes but I couldn't find one that directs me from this path of

> development. Do I need to manually create a WSDL from this schema then

> use the wsdl2java tool to generate a stub?
>
> Thanks.
>


--
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 - schema and WSDL

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
Yes - right now the tools available in Axis2 does not let you directly
convert a schema into a web service so you will have to make a WSDL
document that uses that schema. However making a doc/lit WSDL using
your schema is quite simple and straight forward. I have included a
simple format you can follow

<definitions targetNamespace="xx' xmlns:tns="xx">
   <!-- don't forget the other namespaces in the parent !! -->
    <types>
      <schema>
         <!-- import your schema here -->
      </schema>
    </types>
   <!-- define two messages - one for input and one for output
         the names really does not matter since they are only used
         for reference -->
   <message name="input">
        <part element="yourInputMessageElement" name="part1"/>
    </message>
    <message name="output">
        <part element="yourInputMessageElement" name="part1"/>
    </message>

    <portType name="YourPorttypeName">
        <operation name="yourOperationName">
            <input message="tns:input" name="in"/>
            <output message="tns:output" name="out"/>
        </operation>
    </portType>

  <binding name="yourBinding"
        type="tns:YourPorttypeName">
        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="yourOperationName">
            <soap:operation soapAction="http://soapinterop.org/"
style="document"/>
            <input name="in">
                <soap:body  use="literal"/>
            </input>
            <output name="out">
                <soap:body  use="literal"/>
            </output>
        </operation>
   </binding>

    <service name="yourServiceName">
        <port binding="tns:yourBinding"
            name="yourPort">
            <soap:address
                location="http://some-dummy-address"/>
        </port>
    </service>
</definitions>

Note that the names of the portTypes bindings etc can be anything but
the generated classes do reflect them. Say the generated java classs
will contain the methods with the operation names.

HTH
Ajith

On 12/22/06, Danny Lin <Li...@doc.state.sc.us> wrote:
>
>
> We are limited to use a pre-defined schema to create a web service. I have
> the schema as well as an sample XML document. What should I do next to
> create a web service in Axis2? I've read through all the sample codes but I
> couldn't find one that directs me from this path of development. Do I need
> to manually create a WSDL from this schema then use the wsdl2java tool to
> generate a stub?
>
> Thanks.
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 - schema and WSDL

Posted by Comain Chen <co...@gmail.com>.
I think the binding framerk allows generating Web service implementation
classes from the schema, then you are done.

On 12/23/06, Danny Lin <Li...@doc.state.sc.us> wrote:
>
>  We are limited to use a pre-defined schema to create a web service. I
> have the schema as well as an sample XML document. What should I do next to
> create a web service in Axis2? I've read through all the sample codes but I
> couldn't find one that directs me from this path of development. Do I need
> to manually create a WSDL from this schema then use the wsdl2java tool to
> generate a stub?
>
> Thanks.
>
>



-- 
Best regrads,
Comain Chen