Understanding SOAP: Matt Baker University of Arkansas Mmb05@uark - Edu
Understanding SOAP: Matt Baker University of Arkansas Mmb05@uark - Edu
Understanding SOAP: Matt Baker University of Arkansas Mmb05@uark - Edu
Two major design goals for SOAP are simplicity and extensibility. SOAP
attempts to meet these goals by omitting features that are often found in
distributed systems. Such features include "reliability", "security", "correlation",
"routing", and "Message Exchange Patterns" (MEPs). Other features are left to
be defined as extensions by other specifications.
http://www.w3.org/TR/soap12-part1/#intro
Where does SOAP fit?
User calls web service, passing any
SOAP parameters necessary
</soap:Envelope>
required
SOAP: Header
• Actor (a.k.a. role in SOAP 1.2)
• Single message can be routed to multiple
nodes (sent to a security node, then
routed to a charging node, for example)
• mustUnderstand
• Similar to a required function parameter
• mustUnderstand=”1” means service
(or actor) MUST processed by recipient
SOAP: Body
Request
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
• Child elements
<soap:Body>
<m:GetPrice xmlns:m="http://www.w3schools.com/prices">
are defined by
<m:Item>Apples</m:Item>
</m:GetPrice> service’s
</soap:Body>
</soap:Envelope> namespace
Response • Namespaces
<?xml version="1.0"?>
(xmlns:) helps
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope" determine which
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<m:GetPriceResponse
function to call
xmlns:m="http://www.w3schools.com/prices"> (call GetPrice from
<m:Price>1.90</m:Price>
</m:GetPriceResponse> w3schools.com)
</soap:Body>
</soap:Envelope>
SOAP Faults
• Fault elements defined by SOAP’s default
namespace
• Fault elements
• <faultcode> identifies error to application
• VersionMismatch error: wrong version of SOAP used
• MustUnderstand error: Header element not recognized
• Client error: If caller (client) sends malformed message
• Server error (most common): Error processing at server
• <faultstring> identifies error to client
• <faultactor> identifies where error took place
• <detail> better debug info (line number, etc.)
SOAP Faults
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<soap:Fault>
<faultcode>soap:MustUnderstand</faultcode>
<faultstring>Mandatory Header error.</faultstring>
<faultactor>http://www.wrox.com/heroes/endpoint.asp</faultactor>
<detail>
<w:source xmlns:w="http://www.wrox.com/">
<module>endpoint.asp</module>
<line>203</line>
</w:source>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
UDDI: Universal
Description, Discovery
and Integration
• Human-readable XML
• Easy to debug
• SOAP runs over HTTP
• Firewalls not affected
• Services can be written in any language,
platform or operating system
Disadvantages
• S-L-O.......................................W
• XML produces a lot of overhead for small
messages
• Web Service speed relies on Internet
traffic conditions
• Not strictly-typed XML
• DTD’s, namespaces not explicitly required
Sources
SOAP Tutorial http://www.w3schools.com/soap/default.asp