Soap

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 18

Group 9 - SOAP

Bernard Cheng
Juhan Houang
Brandon Jew
Naoya Makino
Stephen Tiu
Agenda
• What is SOAP?
• Structure of a SOAP message
• Advantages of Using SOAP?
• Disadvantages of SOAP?
• Demonstration & Q&A
What is SOAP?
• Simple Object Access Protocol
• Highly flexible RPC communication
protocol
• Bridges technologies in a standardized
way
• Interoperability
Structure of a SOAP Message
The Structure of a SOAP Message
• The SOAP envelope
o Identifies the XML doc as a SOAP msg
• The SOAP header
o Contains header info
• The SOAP body
o Contains call and response info
• The SOAP fault
o Contains errors and status info
The SOAP Envelope Element
The xmlns:soap Namespace
Envelopexmlns:soap=
"http://www.w3.org/2001/12/soap-envelope"

The encodingStyle Attribute


soap:encodingStyle="URI"
The SOAP Header Element
The mustUnderstand Attribute
Indicate whether a header entry is mandatory or optional
soap:mustUnderstand="0|1"

The actor Attribute


Used to address the Header element to a specific endpoint
soap:actor="URI"

The endocingStyle Attribute


Used to define the data types used in the doc
soap:encodingStyle="URI"
SOAP Fault Element
Used to indicate error messages
Sub Element
• <faultcode>: a code for identifying the fault
• <faultstring>: an explanation of the fault
• <faultactor>: info about who caused the fault to happen
• <detail>: application specific error info related to the Body
element
SOAP Example
<?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>
  <m:GetPrice
xmlns:m="http://www.example.com/prices">
    <m:Item>Apples</m:Item>
  </m:GetPrice>
</soap:Body>

</soap:Envelope>
SOAP Response
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-
envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soa
p-encoding">

<soap:Body>
  <m:GetPriceResponse
xmlns:m="http://www.example.com/prices">
    <m:Price>1.90</m:Price>
  </m:GetPriceResponse>
</soap:Body>

</soap:Envelope>
Advantages
• Interoperability
• Standardized protocol allows for easy
integration with multiple web services
• Sits on top of other protocols – focuses
purely on handling & processing
messages
• allow remote procedure calls
Disadvantages?
• XML can be consumed by overhead
(Angle Bracket Tax)
• Inefficient for short messages
• Severe security issues: "We poke holes in
your firewall so you don’t have to!" 
• CORBA + IIOP is faster, requires less
chatter
DEMO

You might also like