Yen,

Here's a minor walk through, takeing the wsdl backwards:

1) You have on Web Service Endpoint at
http://localhost:888/axis/services/StockService with a soap binding called
"StockWSSoap":

<wsdl:service name="StockWS">
        <wsdl:port name="StockWSSoap" binding="tns:StockWSSoap">
                <soap:address
location="http://localhost:888/axis/services/StockService"/>
        </wsdl:port>
</wsdl:service>

2) The "StockWSSoap" soap binding use document/literal which means the
messages are defined by XML Schema, and it has an soapAction with the value
"http://www.amla.com.com/schemas/webservices/GetStock"; which will be present
as an HTTP header. It defines the soap binding for the portType
"StockWSSoap"

<wsdl:binding name="StockWSSoap" type="tns:StockWSSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
style="document"/>
        <wsdl:operation name="GetStock">
                <soap:operation
soapAction="http://www.amla.com.com/schemas/webservices/GetStock";
style="document"/>
                <wsdl:input>
                        <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                        <soap:body use="literal"/>
                </wsdl:output>
        </wsdl:operation>
</wsdl:binding>

3) The portType "StockWSSoap" is defined by an input and an output message.
You were interested in the output message (the reply) to we have to look for
the "GetStockSoapOut" message.

<wsdl:portType name="StockWSSoap">
        <wsdl:operation name="GetStock">
                <wsdl:input message="tns:GetStockSoapIn"/>
                <wsdl:output message="tns:GetStockSoapOut"/>
        </wsdl:operation>
</wsdl:portType>

4) Quite simply just the schema element "GetStockResponse" in the namespace
corresponding to the "tns" prefix which is
"http://www.amla.com.com/schemas/webservices/";. 

<wsdl:message name="GetStockSoapOut">
        <wsdl:part name="parameters" element="tns:GetStockResponse"/>
</wsdl:message>

5) The schema for that namespace gives you the definition for the repsonse
message, and it's defined by using typedefinitions in another namespace
"http://www.amla.com/schemas/basetypes/";

<s:schema elementFormDefault="qualified"
targetNamespace="http://www.amla.com.com/schemas/webservices/";>
        <s:import namespace="http://www.amla.com/schemas/basetypes/"/>
        <s:element name="GetStock">
                <s:complexType>
                        <s:sequence>
                                <s:element name="objRequest"
type="s1:GetStockDataReq"/>
                        </s:sequence>
                </s:complexType>
        </s:element>
        
        <s:element name="GetStockResponse">
                <s:complexType>
                        <s:sequence>
                                <s:element name="GetStockResult"
type="s1:GetStockDataResp"/>
                        </s:sequence>
                </s:complexType>
        </s:element>
</s:schema>

<s:schema elementFormDefault="qualified"
targetNamespace="http://www.amla.com/schemas/basetypes/";>
        <s:complexType name="GetStockDataReq">
                <s:sequence>
                        <s:element name="ID" type="s:string"/>
                </s:sequence>
        </s:complexType>

        <s:complexType name="GetStockDataResp">
                <s:sequence>
                        <s:element name="Info" type="s1:Result"/>
                </s:sequence>
        </s:complexType>
        
        <s:complexType name="Result">
                <s:sequence>
                        <s:element name="ReturnMark" type="s:string"/>
                </s:sequence>
        </s:complexType>
</s:schema>

6) so an instance of the payload message could look like:

<?xml version="1.0" encoding="UTF-8"?>
<GetStockResponse xmlns="http://www.amla.com.com/schemas/webservices/";
xmlns:s1="http://www.amla.com/schemas/basetypes/";>
        <GetStockResult>
                <s1:Info>
                        <s1:ReturnMark>String</s1:ReturnMark>
                </s1:Info>
        </GetStockResult>
</GetStockResponse>

Of cause you'll have to wrap the message in the soap envelope.

Regards
Brian


-----Original Message-----
From: Yen [mailto:[EMAIL PROTECTED] 
Sent: 17. maj 2005 06:40
To: [email protected]
Subject: How the SOAP Response Message looks like for this service

Hi All,

I have below wsdl:

--------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions       xmlns:s1="http://www.amla.com/schemas/basetypes/";
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:s="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="http://www.amla.com.com/schemas/webservices/";
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
targetNamespace="http://www.amla.com.com/schemas/webservices/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
<wsdl:types>
   <s:schema   elementFormDefault="qualified"
targetNamespace="http://www.amla.com.com/schemas/webservices/";>
     <s:import namespace="http://www.amla.com/schemas/basetypes/"; />
     <s:element name="GetStock">
       <s:complexType>
         <s:sequence>
           <s:element  name="objRequest" type="s1:GetStockDataReq" />
         </s:sequence>
       </s:complexType>
     </s:element>
     <s:element name="GetStockResponse">
       <s:complexType>
         <s:sequence>
           <s:element  name="GetStockResult" type="s1:GetStockDataResp" />
         </s:sequence>
       </s:complexType>
     </s:element>
   </s:schema>
   <s:schema   elementFormDefault="qualified"
targetNamespace="http://www.amla.com/schemas/basetypes/";>
     <s:complexType name="GetStockDataReq">
       <s:sequence>
         <s:element  name="ID" type="s:string" />
       </s:sequence>
     </s:complexType>
     <s:complexType name="GetStockDataResp">
       <s:sequence>
         <s:element  name="Info" type="s1:Result" />
       </s:sequence>
     </s:complexType>
     <s:complexType name="Result">
       <s:sequence>
         <s:element  name="ReturnMark" type="s:string" />
       </s:sequence>
     </s:complexType>
   </s:schema>
</wsdl:types>
<wsdl:message name="GetStockSoapIn">
       <wsdl:part name="parameters" element="tns:GetStock" />
</wsdl:message> <wsdl:message name="GetStockSoapOut">
       <wsdl:part name="parameters" element="tns:GetStockResponse" />
</wsdl:message> <wsdl:portType name="StockWSSoap">
       <wsdl:operation name="GetStock">
               <wsdl:input message="tns:GetStockSoapIn" />
               <wsdl:output message="tns:GetStockSoapOut" />
       </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="StockWSSoap" type="tns:StockWSSoap">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
style="document" />
       <wsdl:operation name="GetStock">
               <soap:operation
soapAction="http://www.amla.com.com/schemas/webservices/GetStock";
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="StockWS">
       <wsdl:port name="StockWSSoap" binding="tns:StockWSSoap">
               <soap:address
location="http://localhost:888/axis/services/StockService"; />
       </wsdl:port>
</wsdl:service>
</wsdl:definitions>
--------------------------------------------------------------------------


Can anyone please tell me how the soap response message looks like for this
service ?


Thanks & Regards,
Kumar.


Reply via email to