Web service example 8: SOAP request and response messages

Previous Next

This topic provides background information about the SOAP messages that are sent in Web Service Example 8: Component Table with an Input XSL Transformation. In example 8, the following client SQL statement is executed (by executing a query from an info window):



WHERE search_destination='AUSTRALIA'

The Web Service component internally translates this SQL statement into the component table XML format:



<Field Value="AUSTRALIA" Index="0"/>



The Input XSL transformation that you wrote in Example 8 transforms this into:

<SearchDestination xmlns="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl">


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

<wsdl:operation name="GetMultipleTours">

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

<wsdl:input name="GetMultipleTours">

<soap:body use="literal"/>


<wsdl:output name="GetMultipleToursResponse">

<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="Windows-1252"?>






        <SearchDestination 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:Tours documentName="Tours">






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

The Output XSL transformation that you wrote in Example 8 transforms the body of this SOAP message into:

<Table xmlns:ns1="http://MyWebServer/TravelService/TRAVELSERVICE.wsdl">


    <Field Name="DESTINATION" Value="AUSTRALIA" Index="1"/>

    <Field Name="TOUR_TYPE" Value="ISLAND SUNTANNER" Index="2"/>

    <Field Name="NUM_DAYS" Value="13" Index="3"/>

    <Field Name="MAX_AGE" Value="65" Index="4"/>

    <Field Name="DESCRIPTION" Value="sailing adventure" Index="5"/>



    <Field Name="DESTINATION" Value="AUSTRALIA" Index="1"/>

    <Field Name="TOUR_TYPE" Value="ROCK 'N' ALICE" Index="2"/>

    <Field Name="NUM_DAYS" Value="12" Index="3"/>

    <Field Name="MAX_AGE" Value="65" Index="4"/>

    <Field Name="DESCRIPTION" Value="Ayers Rock climb" Index="5"/>



Finally, this XML document is represented as record set in the info window.