In this lesson, you call the wrapper procedure created in the previous lesson, which sends a SOAP request to the web server that you created in lesson one.
This lesson assumes that you have set up a web server as instructed in lesson 1.
This lesson assumes that you have set up a web client as instructed in lesson 2.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using SAP Sybase IQ to access a SOAP/DISH service.
The FToC web service procedure sends the Fahrenheit value and the SOAP headers to the web server. The SOAP request contains the following.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://localhost:8082"> <SOAP-ENV:Header> <Authentication xmlns="SecretAgent" mustUnderstand="1"> <userName alias="99"> <first>Susan</first> <last>Hilton</last> </userName> </Authentication> <Session xmlns="SomeSession">123456789</Session> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:FtoCService> <m:fahrenheit>212</m:fahrenheit> </m:FtoCService> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The FtoC procedure then receives the response from the web server which includes a result set based on the Fahrenheit value. The SOAP response contains the following.
<SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:tns='http://localhost:8082'> <SOAP-ENV:Header> <Authentication xmlns="SecretAgent" alias="99" mustUnderstand="1"> <first>Susan</first> <last>Hilton</last> </Authentication> </SOAP-ENV:Header> <SOAP-ENV:Body> <tns:FtoCServiceResponse> <tns:FtoCServiceResult xsi:type='xsd:string'> <tns:rowset xmlns:tns="http://localhost:8082/ftc">
 <tns:row>
 <tns:answer>100 </tns:answer>
 </tns:row>
 </tns:rowset>
 </tns:FtoCServiceResult> <tns:sqlcode>0</tns:sqlcode> </tns:FtoCServiceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The content of <SOAP-ENV:Header> is returned in inoutheader.
If you examine the SOAP response, you can see that the result set was encoded in the response by the FToCService web service. The result set is decoded and returned to the FahrenheitToCelsius procedure. The result set looks like the following when a Fahrenheit value of 212 is passed to the web server:
<tns:rowset xmlns:tns="http://localhost:8082/ftc"> <tns:row> <tns:answer>100 </tns:answer> </tns:row> </tns:rowset>
The SELECT statement in the FahrenheitToCelsius procedure uses the OPENXML function to parse the SOAP response, extracting the Celsius value defined by the tns:answer structure.
The following result set is generated in Interactive SQL:
Fahrenheit Celsius 212 100