Web Service Example 5: SOAP request and response messages

Previous Next

This topic provides background information about the SOAP messages that are sent in Web Service Example 5: Document-Oriented Method with Complex Type Parameters.

In example 5, the following client SQL statement is executed:



SELECT '<Destination xmlns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl">AUSTRALIA</Destination>'

The Web Service component handles this statement, and composes a SOAP request message. The information how to compose this message is defined in the TRAVELSERVICE.wsdl file:

<wsdl:operation name="GetScheduledTours">

   <soap:operation soapAction="http://MyWebServer/TravelService/TRAVELSERVICE.asp#GetScheduledTours" style="document"/>

   <wsdl:input name="GetScheduledTours">

       <soap:body use="literal"/>


   <wsdl:output name="GetScheduledToursResponse">

       <soap:body use="literal"/>



In this code fragment, the attributes style="document" and use="literal" do NOT result in any method names or parameter names appearing in the SOAP request message. This is why in a document-oriented method, all XML elements must be included in the SQL statement:

<?xml version="1.0" encoding="UTF-8"?>





<soapenv:Body>    <Destination xmlns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl"





The body of this SOAP request message includes the XML elements that are included in the SQL statement.

Next, the following statement is sent to the Rules Service:




SELECT '... soap message above ...' request

Then, the Web Service provider composes a SOAP response:





   <tns:Scheduled_Tours documentName="Scheduled Tours">

       <SCHEDTOUR TOUR_TYPE="ISLAND SUNTANNER" START_DATE="2005-11-01000000" RETURN_DATE="2005-11-13000000" PRICE="120" MAX_PART="10" GUIDE="137">


       <SCHEDTOUR TOUR_TYPE="ISLAND SUNTANNER" START_DATE="2005-11-15000000" RETURN_DATE="2005-11-27000000" PRICE="122" MAX_PART="5" GUIDE="6">





The body of this SOAP response message only includes the Scheduled_Tours parameter of the web service provider method in XML format.