axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Lin" <Lin.Da...@doc.state.sc.us>
Subject RE: Axis2 - schema and WSDL
Date Sat, 23 Dec 2006 16:53:57 GMT
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 <Lin.Danny@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


Mime
View raw message