CS7_SOAP
CS7_SOAP
Akshaya Ganesan
Assistant Professor[Off-Campus]
BITS-Pilani
Precap
• <SOAP-ENV:Header>
• ...
• ...
• </SOAP-ENV:Header>
• <SOAP-ENV:Body>
• ...
• ...
• <SOAP-ENV:Fault>
• ...
• ...
• </SOAP-ENV:Fault>
• ...
• </SOAP-ENV:Body>
• </SOAP_ENV:Envelope>
SOAP Message
All these elements are declared in the default namespace for the SOAP envelope
− http://www.w3.org/2001/12/soap-envelope and the default namespace for SOAP encoding and
data types is − http://www.w3.org/2001/12/soap-encoding
FAULT
<env:Fault>
<env:Code>
<env:Value>env:Sender</env:Value>
<env:Subcode>
<env:Value> m:InvalidPurchaseOrder </env:Value>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en-UK"> Specified product did not exist </env:Text>
</env:Reason>
<env:Detail>
<err:myFaultDetails
xmlns:err="http://www.plastics_supply.com/
faults">
<err:message> Product number contains invalid
characters
</err:message>
<err:errorcode> 129 </err:errorcode>
</err:myFaultDetails>
</env:Detail>
</env:Fault>
SOAP Request Response Message
POST / temp HTTP / 1 . 1 HTTP / 1 . 1 2 0 0 OK
Host: www. socweather . com Content−Type: t e x t / xml ; c h a r s e t ="utf-8"
Content−Type: t e x t / xml ; c h a r s e t ="utf-8" Content−Length: xxx
Content−Length: xxx SOAPAction: "http://www.socweather.com/temp"
SOAPAction: http://www.socweather.com/temp
<!−− The above are HTTP heade r f i e l d s −−> <?xml version ="1.0"?>
<?xml version ="1.0"?> <env:Envelope
<env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" e n v : e n c o d i n g S t y l e=
e n v : e n c o d i n g S t y l e= "http://schemas.xmlsoap.org/soap/encoding/"/> "http://schemas.xmlsoap.org/soap/encoding/"/>
<env:Body> <env:Body>
<m:GetTemp <m:GetTempResponse
xmlns:m="http://www.socweather.com/temp.xsd"> xmlns:m="http://www.socweather.com/temp.xsd">
<m:City>Honolulu</m:City> <DegreesCelcius>30</ DegreesCelcius>
<m:When>now</m:When> </m:GetTempResponse>
</m:GetTemp> </env:Body>
</env:Body> </ env:Envelope>
</ env:Envelope>
Document and RPC style
<env:Envelope
xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope">
<env:Header>……..
</env:Header>
<env:Body>
<po:PurchaseOrder orderDate="2004-12-02"
xmlns:m="http://www.plastics_supply.com/POs">
<po:from>
<po:accountName> RightPlastics </po:accountName>
<po:accountNumber> PSC-0343-02 </po:accountNumber>
</po:from>
<po:to>
<po:supplierName> Plastic Supplies Inc.
</po:supplierName>
<po:supplierAddress> Yara Valley Melbourne
</po:supplierAddress>
</po:to>
<po:product>
<po:product-name> injection molder </po:product-name>
<po:product-model> G-100T </po:product-model>
<po:quantity> 2 </po:quantity>
</po:product>
</ po:PurchaseOrder >
</env:Body>
</env:Envelope>
WSDL
Web Service Description Language (WSDL) is a standard used to describe the interface of a web service
• The description includes definitions of data types, input, and output message formats, the
operations provided by the service, network addresses, and protocol bindings.
• WSDL provides a robust, modular, and extensible service description language.
• WSDL description enables reuse
WSDL
Structure of WSDL
http://www.dneonline.com/calculator.asmx?WSDL
• <definitions>
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
</definitions>
UDDI
Universal Description, Discovery, and Integration (UDDI)
• Directories collect and organize location and description information and make it available to
clients needing it.
• It defines an online registry
• Service providers, can describe their organization and register their Web services.
• Service requesters and users can then use the registry to locate their needed services.