SOAP IS:
Lightweight communication protocol
For communication between applicationsone-way, request/response, multicast, etc..
Designed to communicate via HTTP
Not tied to any component technology
Not tied to any programming language
Based on XML
Simple and extensible
2. 2
Where did it come from?
• Microsoft, UserLand, DevelopMentor, IBM, Ariba,
Commerce One, Compaq, HP, IONA, Lotus, SAP
~ Submitted to W3C May 2000.
• XML based protocol
• Intended to be a simple wire-protocol for exchange of
info. Largest use may be over Internet HTTP.
3. 3
Motivation
• Many Distributed applications communicate using remote
procedure calls (RPC) between distributed objects like
DCOM and CORBA.
• HTTP isn’t designed for those objects, so RPC calls aren’t
easily adapted to the Internet.
• Security problems exist for those methods of RPC, so
most firewalls and proxy servers are set to block this
traffic.
• HTTP is supported by all Internet browsers and servers,
so SOAP presents a nice protocol for doing RPC.
4. 4
What is SOAP?
SOAP IS:
• Lightweight communication protocol
• For communication between applications
one-way, request/response, multicast, etc..
• Designed to communicate via HTTP
• Not tied to any component technology
• Not tied to any programming language
• Based on XML
• Simple and extensible
5. 5
Basic Structure of Soap
• Envelope
Defines the content of the message
• Header (optional)
contains header information
• Body
contains call and response information
6. 6
SOAP Contains Four Parts:
• An extensible envelope expressing (mandatory)
• what features and services are represented in a message;
• who should deal with them,
• whether they are optional or mandatory.
• A set of encoding rules for data (optional)
• Exchange instances of application-defined data types and directed
graphs
• Uniform model for serializing abstract data models that can not
directly be expressed in XML schema
• A Convention for representation RPC (optional)
• How to make calls and responses
• A protocol binding to HTTP and HTTP-EF (optional)
8. 8
SOAP Example in SIP
SOAP Envelope
SIP Request
SOAP-SIP Binding
SOAP Body
SERVICE sip:broker.ubiquity.net SIP/2.0
To: sip:broker.ubiquity.net
From: sip:proxy.ubiquity.net
Call-ID:648324@193.195.52.30
CSeq: 1 SERVICE
Via: SIP/2.0/UDP proxy.ubiquity.net
Content-Type: text/xml
Content-Length: 381
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Body>
<m:SetCreditStatus xmlns:m="http://www.ubiquity.net/sipservices">
<m:user>sip:jo@ubiquity.net</m:user>
<m:status>super</m:status>
</m:SetCreditStatus>
</SOAP:Body>
</SOAP:Envelope>
9. 9
… or SOAP by Itself…
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope”
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<m:MessageInfo xmlns:m="http://www.info.org/soap/message">
<m:to href="mailto:you@your.com"/>
<m:from href="mailto:me@my.com"/>
<m:contact href="mailto:someone@my.com">
</m:MessageInfo>
</SOAP:Header>
<SOAP:Body>
<msg:Message xmlns:m="http://www.info.org/soap/message">
<msg:subject>Your house is on fire!</msg:subject>
<msg:feed href="ram://livenews.com/yourhouse"/>
</msg:Message>
</SOAP:Body>
</SOAP:Envelope>
10. 10
Note Again: SOAP is a Protocol!
• What does this mean?
• It is not a distributed object system
• It is not an RPC system
• It is not even a Web application
• Your application decides what your application is!
• You can build a tightly coupled system
…or…
• You can build a loosely coupled system
11. 11
Why Not Roll My Own XML Protocol?
• SOAP allows you to define your particular feature or
service in such a way that it can co-exist with other
features and services within a SOAP message
• What is a feature or a service?
• Authentication service
• Payment service
• Security service
• Transaction management service
• Privacy service
• Not owning the message means easier deployment and
better interoperability
12. 12
Syntax Rules
• MUST be encoded using XML
• MUST have a SOAP Envelope
• CAN have a SOAP header
• MUST have a SOAP Body
• MUST use the SOAP Envelope namespace
• MUST use the SOAP Encoding namespace
• Must NOT contain a DTD reference
• Must NOT contain XML Processing
13. 13
SOAP Fault Element
• Error messages from a SOAP application are carried inside a Fault element.
• Must appear as an element w/in the <Body> element and can only appear once in a SOAP
message.
• Fault sub elements:
<faultcode> MUST: --code identifying the error, for use by the software
<faultstring> MUST: --error as a string
<faultactor> MUST(Apps not acting as ultimate destination of SOAP message)
--who caused the error
<detail> MUST(if contents of Body could not be successfully processed)
--specific error information
• Fault Codes:
VersionMismatch Invalid namespace for the SOAP Envelope Element
MustUnderstand A child element of the Header element, with the mustUnderstand attribute
set to “1”, was not understood
Client The message was incorrectly formed or contained incorrect information.
Server There was a problem with the server so the message could not be process
• Example: <env:Fault>
<faultcode>env:MustUnderstand</faultcode>
<faultstring>SOAP Must Understand Error</faultstring>
</env:Fault>
14. 14
CORBA vs. SOAP
CORBA
(Common Object Request Broker
Architecture)
SOAP
(Simple Object Access Protocol)
CORBA provides a true object-oriented
component architecture.
Web services like (UDDI/WSDL/SOAP)
are not providing true object-oriented
component architecture.
Fast Compared to SOAP Because of the verbose XML format,
SOAP can be considerably slower than
CORBA
Can be difficult to use if server and/or
client is behind a firewall or if network
address translation is being used
HTTP works well with network
firewalls
Problems with implementations It is XML based implementation
compare to
CORBA,SOAP Implementation is easy.
It uses IIOP (Internet Inter ORB
Protocol)
Simple XML-based protocol to let
applications exchange information
over HTTP
15. 15
Advantages of SOAP are:
• Portability
• Firewall friendliness
• Use of open standards
• Interoperability
• Universal acceptance.
Language neutrality:
SOAP can be developed using any language.
• Interoperability and Platform Independence:
SOAP can be implemented in any language and can be
executed in any platform.
SOAP messages are in very simple XML format.
• Scalability:
SOAP uses HTTP protocol for transport due to which it
becomes scalable.
16. 16
Disadvantages of SOAP
• – Too much reliance on HTTP
• – Statelessness
• – Serialization by value and not by reference
17. 17
Summary
• SOAP envelope provides
• SOAP can be used with many protocols
• Easy to deploy with existing infrastructure
• SOAP is fundamentally a one-way message
• Supports request/response, RPC etc.
• Your application decides what it is!
Notes de l'éditeur
SIP (Session Initiation Protocol) is a text-based signaling protocol used to establish multimedia sessions on the Internet