An old fashion to build Axis Web Service (1)

WSDL Structure



           <s:schema targetNamespace="xxxxxx">

                  <s:element name="bbb" type="s:ComplexType"/>

<s:element name="bbbResponse" type="s:ComplexType "/>



<wsdl:message name=" bbbSoapIn ">

<wsdl:part name="parameter" element="tns:bbb"/>


<wsdl:message name=" bbbSoapOut ">

<wsdl:part name="parameter" element="tns:bbbResponse"/>


    <wsdl:portType name="xxxPortType">

           <wsdl:operation name="zzz">

                  <wsdl:input message="tns:bbbSoapIn"/>

                  <wsdl:output message="tns:bbbSoapOut"/>



    <wsdl:binding name="xxxSoapBinding" type="tns:xxxPortType">

<soap:binding style="document" transport=""/>

           <wsdl:operation name="store">

                  <soap:operation soapAction="http://localhost:8080/services/xxx/store" style="document"/>


                        <soap:body use="literal"/>



                        <soap:body use="literal"/>




    <wsdl:service name="xxxService">

           <wsdl:documentation>xxx Service</wsdl:documentation>

           <wsdl:port name="xxx" binding="tns:xxxSoapBinding">

                  <soap:address location="http://localhost:8080/services/xxx"/>





Few things need to be aware of in the structure of WSDL file, which have been highlighted above:

  • Message – if the parameter is complex type, element should be used

<wsdl:part name="parameter" element="tns:bbb"/>

            If it is a primitive (defined by the standard schema), may also use

<wsdl:part name="parameter" type="s:string"/>

Message for response of the web service should have their parameter named with “Response” suffix and input element must be the same as the operation name (This definitely works with RPC service and document, but not sure for the others)


Importing external schema


import schema

<s:schema targetNamespace="" xmlns:sapParam="urn:sapParam">

    <s:import namespace="urn:sapParam" schemaLocation="file:///C:/dev /mySchema.xsd"/>

    <s:element name="doTest">



             <s:element name="inputParam" type="sapParam:sap_import_main"/>




    <s:element name="doTestResponse">



           <s:element name="reponseParam" minOccurs="1" type="s:string"/>






Few things you need to be aware while importing the external schema

    • You have to declare the namespace attribute for the import tag, in order to reference the schema content from WSDL (in s:schema xmlns:sapParam="urn:sapParam)
    • A brief introduction of schema is given in the later part of this article
    • There is a naming standard for using external schema, please check it for your preference.


This entry was posted in Web Service. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s