soap (simple object access protocol)

22
SOAP SOAP (Simple Object Access Protocol) (Simple Object Access Protocol) Matt Brodie Matt Brodie March 20 March 20 th th 2006 2006

Upload: cyrus-harvey

Post on 31-Dec-2015

31 views

Category:

Documents


1 download

DESCRIPTION

SOAP (Simple Object Access Protocol). Matt Brodie March 20 th 2006. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SOAP (Simple Object Access Protocol)

SOAPSOAP(Simple Object Access Protocol)(Simple Object Access Protocol)

Matt BrodieMatt BrodieMarch 20March 20thth 2006 2006

Page 2: SOAP (Simple Object Access Protocol)

"To help developers build Web services and "To help developers build Web services and link heterogeneous components over the link heterogeneous components over the Internet, Microsoft worked with industry Internet, Microsoft worked with industry experts to create the Simple Object Access experts to create the Simple Object Access Protocol. SOAP provides an open, extensible Protocol. SOAP provides an open, extensible way for applications to communicate using way for applications to communicate using XML-based messages over the Web, XML-based messages over the Web, regardless of what operating system, object regardless of what operating system, object model or language particular applications may model or language particular applications may use. SOAP facilitates universal communication use. SOAP facilitates universal communication by defining a simple, extensible message by defining a simple, extensible message format in standard XML and thereby providing format in standard XML and thereby providing a way to send that XML message over HTTP. a way to send that XML message over HTTP. Microsoft is soliciting industry feedback on Microsoft is soliciting industry feedback on version 0.9 of the SOAP specification. . ." [MS version 0.9 of the SOAP specification. . ." [MS announcement, Sept 13 1999]"announcement, Sept 13 1999]"

Page 3: SOAP (Simple Object Access Protocol)

SOAP’s designersSOAP’s designers

Initial development done by a team Initial development done by a team including representatives from:including representatives from: DevelopMentorDevelopMentor IBMIBM LotusLotus MicrosoftMicrosoft UserLand UserLand

Page 4: SOAP (Simple Object Access Protocol)

SOAP’s maintenanceSOAP’s maintenance

Currently under the auspices of the Currently under the auspices of the W3C XML Protocol Working Group, W3C XML Protocol Working Group, which includes representatives of: which includes representatives of: BEA SystemsBEA Systems IBMIBM MicrosoftMicrosoft Sun MicrosystemsSun Microsystems Systinet Systinet Not to mention AT&T, DaimlerChrysler, Intel, Not to mention AT&T, DaimlerChrysler, Intel,

and Fujitsu and Fujitsu

Page 5: SOAP (Simple Object Access Protocol)

some definitionssome definitions "SOAP is a protocol specification for "SOAP is a protocol specification for

invoking methods on servers, services, invoking methods on servers, services, components and objects. SOAP codifies the components and objects. SOAP codifies the existing practice of using XML and HTTP existing practice of using XML and HTTP as a method invocation mechanism. The as a method invocation mechanism. The SOAP specification mandates a small SOAP specification mandates a small number of HTTP headers that facilitate number of HTTP headers that facilitate firewall/proxy filtering. The SOAP firewall/proxy filtering. The SOAP specification also mandates an XML specification also mandates an XML vocabulary that is used for representing vocabulary that is used for representing method parameters, return values, and method parameters, return values, and exceptions." [DevelopMentor]exceptions." [DevelopMentor]

Page 6: SOAP (Simple Object Access Protocol)

continuedcontinued

The Simple Object Access Protocol The Simple Object Access Protocol (SOAP) facilitates interoperability (SOAP) facilitates interoperability among a wide range of programs among a wide range of programs and platforms, making existing and platforms, making existing applications accessible to a broader applications accessible to a broader range of users. SOAP combines the range of users. SOAP combines the proven Web tech no logy of HTTP proven Web tech no logy of HTTP with the flexibility and extensibility with the flexibility and extensibility of XML. [perfectxml.com]of XML. [perfectxml.com]

Page 7: SOAP (Simple Object Access Protocol)

from the original MS from the original MS press releasepress release

SOAP provides an open, extensible way for SOAP provides an open, extensible way for applications to communicate using XML-applications to communicate using XML-based messages over the Web, regardless based messages over the Web, regardless of what operating system, object model or of what operating system, object model or language particular applications may use. language particular applications may use. SOAP facilitates universal communication SOAP facilitates universal communication by defining a simple, extensible message by defining a simple, extensible message format in standard XML and thereby format in standard XML and thereby providing a way to send that XML message providing a way to send that XML message over HTTP. [Microsoft]over HTTP. [Microsoft]

Page 8: SOAP (Simple Object Access Protocol)

the official definitionthe official definition SOAP is a lightweight protocol intended SOAP is a lightweight protocol intended

for exchanging structured information in for exchanging structured information in a decentralized, distributed environment. a decentralized, distributed environment. SOAP uses XML technologies to define an SOAP uses XML technologies to define an extensible messaging framework, which extensible messaging framework, which provides a message construct that can be provides a message construct that can be exchanged over a variety of underlying exchanged over a variety of underlying protocols. The framework has been protocols. The framework has been designed to be independent of any designed to be independent of any particular programming model and other particular programming model and other implementation specific semantics. [W3C]implementation specific semantics. [W3C]

Page 9: SOAP (Simple Object Access Protocol)

repetitious wordsrepetitious words

ExtensibleExtensiblePlatform-nonspecificPlatform-nonspecificUtilizes existing softwareUtilizes existing softwareFacilitates communicationFacilitates communicationSimpleSimple

Page 10: SOAP (Simple Object Access Protocol)

a bit of historya bit of history

Sometime in 1999 – idea created, work Sometime in 1999 – idea created, work startedstarted

May 8, 2000 – submitted to W3C May 8, 2000 – submitted to W3C June 24, 2003 – published as a W3C June 24, 2003 – published as a W3C

recommendationrecommendation Now, development is focused on common Now, development is focused on common

suite of SOAP extensions to add suite of SOAP extensions to add reliability, security, etc. reliability, security, etc. Global XML Web Services Architecture (GXA)Global XML Web Services Architecture (GXA)

Page 11: SOAP (Simple Object Access Protocol)

SOAP’s predecessorsSOAP’s predecessors

DCOM and CORBADCOM and CORBA Remote Procedure Call (RCP) ProtocolsRemote Procedure Call (RCP) Protocols Poorly designed for Web ServicesPoorly designed for Web Services Initially, SOAP was designed to make Initially, SOAP was designed to make

DCOM and CORBA work over the DCOM and CORBA work over the internet. internet.

Page 12: SOAP (Simple Object Access Protocol)

simple depiction of SOAP in simple depiction of SOAP in actionaction

Page 13: SOAP (Simple Object Access Protocol)

SOAPSOAP

is a format for one-way communicationis a format for one-way communication describes how a message should be describes how a message should be

transported through the webtransported through the web governs which portions of the document governs which portions of the document

should be read and by whomshould be read and by whom is a format describing how the client is a format describing how the client

turns the message into an RPC call and turns the message into an RPC call and converts it into a SOAP replyconverts it into a SOAP reply

Page 14: SOAP (Simple Object Access Protocol)

SOAP message structureSOAP message structure

HTTP bindingHTTP binding directs the messagedirects the message

EnvelopeEnvelope always the root element, it helps the server always the root element, it helps the server

identify the message as SOAP, and it is defined identify the message as SOAP, and it is defined by its own schema SOAP-ENVby its own schema SOAP-ENV

Header (optional)Header (optional) specifying usespecifying use Adds features to the SOAP message such as Adds features to the SOAP message such as

authentication, transaction management, authentication, transaction management, payment, message routes, etc…payment, message routes, etc…

BodyBody containing the payloadcontaining the payload

Page 15: SOAP (Simple Object Access Protocol)

very simple examplevery simple example

<Envelope> <Header> <transId>345</transId> </Header> <Body> <Add> <n1>3</n1> <n2>4</n2> </Add> </Body></Envelope>

Page 16: SOAP (Simple Object Access Protocol)

HTTP bindingHTTP binding

directs SOAP message across HTTPdirects SOAP message across HTTP always a POST formatalways a POST format content-type is always “text/xml”content-type is always “text/xml” includes the special header includes the special header

SOAPActionSOAPAction this is not mandatory, supposed to this is not mandatory, supposed to

express the function of the messageexpress the function of the message

Page 17: SOAP (Simple Object Access Protocol)

HTTP binding for a request:POST /string_server/Object17 HTTP/1.1Host: 209.110.197.2Content-Type: text/xmlContent-Length: nnn

Response:200 OKContent-Type: text/xmlContent-Length: nnn

Page 18: SOAP (Simple Object Access Protocol)

<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> <SOAP-ENV:Header> <t:transId xmlns:t=“http://a.com/trans”>345</t:transId> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:Add xmlns:m=“http://a.com/Calculator”> <n1>3</n1> <n2>4</n2> </m:Add> </SOAP-ENV:Body></SOAP-ENV:Envelope>

previous example, previous example, fleshed outfleshed out

Page 19: SOAP (Simple Object Access Protocol)

intermediariesintermediaries

intermediaries act as soap receivers intermediaries act as soap receivers and sendersand senders

they often process messages and they often process messages and send them onsend them on

the SOAP message is encoded with the SOAP message is encoded with instructions for the receiver will deal instructions for the receiver will deal with the messagewith the message it may ignore certain sections of the it may ignore certain sections of the

body, if it is told to in the headerbody, if it is told to in the header

Page 20: SOAP (Simple Object Access Protocol)

drawbacksdrawbacks dozens of SOAP toolkits being used to dozens of SOAP toolkits being used to

build, many interpret message differentlybuild, many interpret message differently SOAP is very ambiguous, no data SOAP is very ambiguous, no data

encoding formatencoding format Just because the server is using SOAP doesn’t Just because the server is using SOAP doesn’t

mean it’s encoding in the way you expect it tomean it’s encoding in the way you expect it to The rules governing encoding within the The rules governing encoding within the

envelope are known as “Section 5 rules”envelope are known as “Section 5 rules” these rules are not required, causing problems these rules are not required, causing problems

when users make assumptions about their usewhen users make assumptions about their use

Page 21: SOAP (Simple Object Access Protocol)

SOAP message exampleSOAP message example

POST /StockQuote HTTP/1.1Host: www.stockquoteserver.comContent-Type: text/xml; charset="utf-8"Content-Length: nnnnSOAPAction: "Some-URI"

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DIS</symbol> </m:GetLastTradePrice> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Page 22: SOAP (Simple Object Access Protocol)

example responseexample response

HTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8"Content-Length: nnnn

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <SOAP-ENV:Body> <m:GetLastTradePriceResponse xmlns:m="Some-URI"> <Price>34.5</Price> </m:GetLastTradePriceResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>