December 13, 2001 - Assembling SOAP Messages | WebReference

December 13, 2001 - Assembling SOAP Messages

Yehuda Shiran December 13, 2001
Assembling SOAP Messages
Tips: December 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

WSDL (Web Services Description Language) can specify SOAP messages. The XML messages below are sent and received as a result of parsing the WSDL file for the specific function (foo). Here is the message sent from the client to make a function call "foo(5131953)":

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope 
SOAP-ENV:encodingStyle="https://schemas.xmlsoap.org/soap/encoding/" 
xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<m:foo xmlns:m="https://tempuri.org/message/">
<arg>5131953</arg>
</m:foo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is the packet received back from the server (response):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope 
SOAP-ENV:encodingStyle="https://schemas.xmlsoap.org/soap/encoding/" 
xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAPSDK1:fooResponse xmlns:SOAPSDK1="https://tempuri.org/message/">
<result>5131953</result>
</SOAPSDK1:fooResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Both the function call message and its response are valid XML. A SOAP message consists of an <Envelope> element that contains an optional <Header> element and at a minimum, one <Body> element.