Вы находитесь на странице: 1из 45

SOAP

GustavoAlonso ComputerScienceDepartment SwissFederalInstituteofTechnology(ETHZ) alonso@inf.ethz.ch http://www.iks.inf.ethz.ch/

ContentsSOAP

Background SOAPoverview StructureofaSOAPMessage ProcessingSOAPMessages MappingSOAPtoatransportprotocol

Gustavo Alonso, D-INFK. ETH Zrich.

Background and historical perspective

BasicProblemstosolve
1. 2.

3.

4.

Howtomaketheserviceinvocationpartofthelanguageinamoreorless transparentmanner. Dontforgetthisimportantaspect:whateveryoudesign,otherswillhaveto programanduse Howtoexchangedatabetweenmachinesthatmightusedifferentrepresentations fordifferentdatatypes.Thisinvolvestwoaspects: datatypeformats(e.g.,byteordersindifferentarchitectures) datastructures(needtobeflattenedandthereconstructed) Howtofindtheserviceoneactuallywantsamongapotentiallylargecollectionof servicesandservers. Thegoalisthattheclientdoesnotnecessarilyneedtoknowwheretheserver residesorevenwhichserverprovidestheservice. Howtodealwitherrorsintheserviceinvocationinamoreorlesselegantmanner: serverisdown, communicationisdown, serverbusy, duplicatedrequests...

Gustavo Alonso, D-INFK. ETH Zrich.

SOAP

RemotecallsinRPC/DCE

Gustavo Alonso, D-INFK. ETH Zrich.

RemotecallsinCORBA
Client Identifying and locating services Interface repository Implementation repository Service (sever)

Client stub CORBA runtime

Skeleton Object adapter

ORB MIDDLEWARE TCP/IP socket

Marshalling and serializing arguments

ORB MIDDLEWARE TCP/IP socket

Local Area Network


Gustavo Alonso, D-INFK. ETH Zrich. 6

RemotecallsinDCOM
Client Identifying and locating services Registry Registry Service (sever)

Client proxy COM runtime

Server stub COM runtime

SCM MIDDLEWARE DCE RPC


SCM = Service Control Manager
Gustavo Alonso, D-INFK. ETH Zrich.

Marshalling and serializing arguments

SCM MIDDLEWARE DCE RPC

Local Area Network


7

Wireprotocols,XMLandSOAP

RPC,CORBA,DCOM,evenJava,use Toaddressthisproblem,XMLwasused differentmechanismsandprotocols todefineSOAP forcommunicating.Allofthemmapto SOAPisconceptuallyquitesimple: TCPorUDPonewayoranotherbut RPCusingHTTP usedifferentsyntaxformarshalling, (attheclient)turnanRPCcall serializingandpackagingmessages intoanXMLdocument Theproblemisthatthesemechanisms arealegacyfromthetimewhen (attheserver)turntheXML communicationsweremostlywithin documentintoaprocedurecall LANsandwithinhomogeneous (attheserver)turnthe systems proceduresresponseintoan BuildingaB2Benvironment XMLdocument combiningthesystemsofdifferent (attheclient)turntheXML companiesbecomesdifficultbecause theprotocolsavailableinRPC,CORBA, documentintotheresponseto orDCOMaretoolowleveland theRPC certainlynotcompatibleamongeach useXMLtoserializethe other(gatewaysareneeded,etc.)

argumentsfollowingtheSOAP specification

Gustavo Alonso, D-INFK. ETH Zrich.

ThebackgroundforSOAP

SOAPwasoriginallyconceivedastheminimalpossibleinfrastructure necessarytoperformRPCthroughtheInternet: useofXMLasintermediaterepresentationbetweensystems verysimplemessagestructure mappingtoHTTPfortunnelingthroughfirewallsandusingtheWeb infrastructure TheideawastoavoidtheproblemsassociatedwithCORBAsIIOP/GIOP (whichfulfilledasimilarrolebutusinganonstandardintermediate representationandhadtobetunneledthroughHTTPanyway) Thegoalwastohaveanextensionthatcouldbeeasilypluggedontopof existingmiddlewareplatformstoallowthemtointeractthroughthe InternetratherthanthroughaLANasintheoriginalcase.Hencethe emphasisonRPCfromtheverybeginning(essentiallyallformsof middlewareuseRPCatoneleveloranother) EventuallySOAPstartedtobepresentedasagenericvehicleforcomputer drivenmessageexchangesthroughtheInternetandthenitwasopenedto supportinteractionsotherthanRPCandprotocolsotherthenHTTP.

Gustavo Alonso, D-INFK. ETH Zrich.

SOAPasRPCmechanism
CLIENT call stubs, runtime service location SOAP system
Serialized XML doc Wrap doc in HTTP POST request

HTTP support (web client)

This could be RPC, CORBA, DCOM, using SOAP as protocol

SERVER service

stubs, runtime adapters

SOAP system
Serialized XML doc

Retrieve doc from HTTP response

HTTP support (web server)


10

Gustavo Alonso, D-INFK. ETH Zrich.

INTERNET

SOAP

WhatisSOAP?

TheW3CstartedworkingonSOAPin1999.ThecurrentW3C recommendationisVersion1.2 Originally:SimpleObjectAccessProtocol SOAPcoversthefollowingmainareas: Messageconstruct:Amessageformatforonewaycommunication describinghowamessagecanbepackedintoanXMLdocument Processingmodel:rulesforprocessingaSOAPmessageandasimple classificationoftheentitiesinvolvedinprocessingaSOAPmessage. Whichpartsofthemessagesshouldbereadbywhomandhowtoreact incasethecontentisnotunderstood ExtensibilityModel:Howthebasicmessageconstructcanbeextended withapplicationspecificconstructs Protocolbindingframework:AllowsSOAPmessagestobe transportedusingdifferentprotocols(HTTP,SMTP,) AconcretebindingforHTTP ConventionsonhowtoturnanRPC callintoaSOAPmessageandback aswellashowtoimplementtheRPCstyleofinteraction
12

Gustavo Alonso, D-INFK. ETH Zrich.

SOAP:amessagingframework

SOAP RPC:Sinceversion1.1,SOAPabstractsfromtheRPCprogramming model SOAPisalightweightprotocolintendedforexchangingstructured information[],astateless,onewaymessageexchangeparadigm Definesthegeneralformatofamessageandhowtoprocessit Morecomplexinteractionpatternscanbecreatedbyapplications RPCisimplementedontopofthecorespecificationfollowingconventions oftheSOAPRPCrepresentation SOAP HTTP:Sinceversion1.1,SOAPabstractsfromtheprotocolusedto transportthemessages HTTPisoneofmanypossibletransports

Gustavo Alonso, D-INFK. ETH Zrich.

13

TheSOAPmessagepath

ASOAPmessagecanpassthrough multiplehops onthewayfrom theinitialsendertotheultimate receiver Theentitiesinvolvedin transportingthemessageare calledSOAPnodes SOAPintermediaries forwardthe messageandmaymanipulateit EverySOAPnodeassumesa certainrole whichinfluencesthe messageprocessingatthenode.

SOAP nodes: Initial sender

Intermedaries

Ultimate receiver

Gustavo Alonso, D-INFK. ETH Zrich.

14

Structure of a SOAP Message

SOAPmessages

SOAPmessage=SOAPenvelope Envelopecontainstwoparts: Header(optional): independentheaderblocks withmetadata(security, transactions,session,) Body:severalblocksof applicationdata SOAPdoesnotdefinethe semanticsoftheheadernorthe body,onlythestructureofthe message.

Envelope Header Header Block Header Block Body Body Element

Gustavo Alonso, D-INFK. ETH Zrich.

16

SkeletonSOAPmessage
<?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:Header> ... ... </soap:Header> <soap:Body> ... ... <soap:Fault> ... ... </soap:Fault> </soap:Body> </soap:Envelope>
From http://www.w3schools.com

Gustavo Alonso, D-INFK. ETH Zrich.

17

TheSOAPheader

Theheaderisintendedasagenericplaceholderforinformationthatis notnecessarilyapplicationdependent(theapplicationmaynotevenbe awarethataheaderwasattachedtothemessage). Typicalusesoftheheaderare:coordinationinformation,identifiers (e.g.,fortransactions),securityinformation(e.g.,certificates) SOAPprovidesmechanismstospecifywhoshoulddealwithheaders andwhattodowiththem.Forthispurposeitincludes: Actor attribute:whoshouldprocessthatparticularheaderblock. BooleanmustUnderstand attribute:indicateswhetheritis mandatorytoprocesstheheader.Ifaheaderisdirectedatanode (asindicatedbytheactorattribute),themustUnderstandattribute determineswhetheritismandatorytodoso. SOAP1.2addsarelay attribute(forwardheaderifnotprocessed)

Gustavo Alonso, D-INFK. ETH Zrich.

18

SOAPHeaderExample
<?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:Header> <m:Trans xmlns:m="http://www.w3schools.com/transaction/" soap:mustUnderstand="1">234</m:Trans> </soap:Header> ... ... </soap:Envelope>
From http://www.w3schools.com

Gustavo Alonso, D-INFK. ETH Zrich.

19

Example:SOAPHeadersforSecurity
RPC Request SOAP Envelope SOAP header Security context Message Signature SOAP Body Name of Procedure Input param 1 Input param 2 RPC Response (one of the two) SOAP Envelope SOAP header Security context Message Signature SOAP Body Return parameter SOAP Envelope SOAP header Security context Message Signature SOAP Body Fault entry

Gustavo Alonso, D-INFK. ETH Zrich.

20

TheSOAPbody

Thebodyisintendedfortheapplicationspecificdatacontainedinthe message Abodyelementisequivalenttoaheaderblockwithattributes actor=ultimateReceiverandmustUnderstand=1 Unlikeforheaderbocks,SOAPdoesspecifythecontentsofsomebody elements: mappingofRPCtoaSOAPbodyelement(RPCconventions) theFaultentry(forreportingerrorsinprocessingaSOAPmessage)

Gustavo Alonso, D-INFK. ETH Zrich.

21

SOAPbodyexample
XML name space identifier for SOAP serialization XML name space identifier for SOAP envelope

<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>
From the: Simple Object Access Protocol (SOAP) 1.1. W3C Note 08 May 2000

Gustavo Alonso, D-INFK. ETH Zrich.

22

SOAPexample,headerandbody
<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:Transaction xmlns:t="some-URI" SOAP-ENV:mustUnderstand="1"> 5 </t:Transaction> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DEF</symbol> </m:GetLastTradePrice> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Gustavo Alonso, D-INFK. ETH Zrich.
From the: Simple Object Access Protocol (SOAP) 1.1. W3C Note 08 May 2000

23

TheSOAPfault

WhenaSOAPmessagecouldnotbeprocessed,aSOAPfaultisreturned Afaultmustcarrythefollowinginformation: FaultCode:indicatingtheclassoferrorandpossiblyasubcode(for applicationspecificinformation) FaultString:humanreadableexplanationofthefault(notintendedfor automatedprocessing) Faultactor:whocausedthefaulttohappen Detail:Applicationspecificdatarelatedtothefault Thefaultcodesinclude: Versionmismatch:invalidnamespaceinSOAPenvelope MustUnderstand:aheaderelementwithmustunderstansettotruewas notunderstood Client:messagewasincorrect(formatorcontent) Server:problemwiththeserver,messagecouldnotbeprocessed Errorsinunderstandingamandatoryheaderblockarerespondedusingafault elementbutalsoincludeaspecialheaderindicatingwhichoneoftheoriginal headerblockswasnotunderstood.

Gustavo Alonso, D-INFK. ETH Zrich.

24

MessageProcessingModel

Foreachmessagereceived,everySOAPnodeonthemessagepathmust processthemessageasfollows Decideinwhichrolestoact(standardroles:nextorultimateReceiver, orotherapplicationdefinedroles).Theserolesmayalsodependonthe contentsofthemessage. Identifythemandatoryheaderblockstargetedatthenode(matching role,mustUnderstand=true) Ifamandatoryheaderblockisnotunderstoodbythenode,afaultmust begenerated.Themessagemustnotbeprocessedfurther. Processthemandatoryheaderblocksand,incaseoftheultimate receiver,thebody.Otherheaderblockstargetedatthenodemaybe processed.Theorderofprocessingisnotsignificant. SOAPintermediarieswillfinallyforwardthemessage Processedheaderblocksmayberemoveddependingonthe specificationfortheblock. Headerblockswhichweretargetedattheintermediarybutnot processedarerelayedonlyifthetherelayattributeissettotrue. ActiveSOAPintermediariesmayalsochangeamessageinwaysnot describedhere(e.g.,encryptthemessage).
25

Gustavo Alonso, D-INFK. ETH Zrich.

RPC with SOAP

SOAPRPCrepresentation

SOAPspecifiesauniformrepresentation forRPCrequestsandresponses whichisplatformindependent.Itdoesnotdefinemappingsto programminglanguages SOAPRPCdoesnotsupportadvancedRPC/RMIfeaturessuchasobject referencesordistributedgarbagecollection.Thiscanbeaddedby applicationsoradditionalstandards(seeWSRF). Formally,RPCisnotpartofthecoreSOAPspecification.Itsuseisoptional.

Gustavo Alonso, D-INFK. ETH Zrich.

27

RPCExample

Request:

<SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DIS</symbol> </m:GetLastTradePrice> </SOAP-ENV:Body>

Response:

<SOAP-ENV:Body> <m:GetLastTradePriceResponse xmlns:m="Some-URI"> <Price>34.5</Price> </m:GetLastTradePriceResponse> </SOAP-ENV:Body>

Gustavo Alonso, D-INFK. ETH Zrich.

28

Mapping SOAP to a transport protocol

SOAPprotocolbindingframework

SOAPmessagescanbetransferredusinganyprotocol AbindingofSOAPtoatransportprotocolisadescriptionofhowa SOAPmessageistobesentusingthattransportprotocol Abindingspecifieshowresponseandrequestmessagesare correlated TheSOAPbindingframeworkexpressesguidelinesforspecifyinga bindingtoaparticularprotocol


SOAP RPC SOAP HTTP TCP IP SMTP UDP

Gustavo Alonso, D-INFK. ETH Zrich.

30

SOAPandHTTP

SOAPmessagesaretypically transferredusingHTTP ThebindingtoHTTPdefinedinthe SOAPspecification SOAPcanuseGETorPOST.With GET,therequestisnotaSOAP messagebuttheresponseisaSOAP message,withPOSTbothrequest andresponseareSOAPmessages(in version1.2,version1.1mainly considerstheuseofPOST).

HTTP POST SOAP Envelope SOAP header Transactional context SOAP Body Name of Procedure Input parameter 1 Input parameter 2

Gustavo Alonso, D-INFK. ETH Zrich.

31

InXML(arequest)
POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8" Content-Length: nnnn SOAPAction: "GetLastTradePrice" <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>
Gustavo Alonso, D-INFK. ETH Zrich. 32

InXML(theresponse)
HTTP/1.1 200 OK Content-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>

Gustavo Alonso, D-INFK. ETH Zrich.

33

Alltogether

HTTP Request SOAP Envelope SOAP header Transactional context SOAP Body Name of Procedure

SERVICE REQUESTER

Input parameter 1 Input parameter 2

SERVICE PROVIDER

RPC call HTTP engine HTTP engine

Procedure

SOAP engine

HTTP Response SOAP Envelope SOAP header Transactional context SOAP Body Return parameter

SOAP engine

Gustavo Alonso, D-INFK. ETH Zrich.

34

Additionalbindings(example)

SOAPoverJavaMessageService1.0RC1:
1 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 2 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 3 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 5 <soapenv:Body soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 6 <postMessage><ngName xsi:type="xsd:string">news.current.events</ngName> 7 <msg xsi:type="xsd:string">This is a sample news item.</msg> 8 </postMessage> 9 </soapenv:Body> 10 </soapenv:Envelope>

Gustavo Alonso, D-INFK. ETH Zrich.

35

Additionalbindings

WSInvocationFramework UseWSDLtodescribeaservice UseWSIFtoletthesystemdecidewhattodowhenthe serviceisinvoked: IfthecallistoalocalEJBthendonothing IfthecallistoaremoteEJBthenuseRMI IfthecallistoaqueuethenuseJMS IfthecallistoaremoteWebservicethenuseSOAPand XML Thereisasingleinterfacedescription,thesystemdecides onthebinding Thistypeoffunctionalityisatthecoreofthenotionof ServiceOrientedArchitecture

Gustavo Alonso, D-INFK. ETH Zrich.

36

SOAP Attachments

Theneedforattachments

SOAPisbasedonXMLand reliesonXMLfor representingdatatypes TheoriginalideainSOAP wastomakealldata exchangedexplicitinthe formofanXMLdocument muchlikewhathappens withIDLsinconventional middlewareplatforms Thisapproachreflectsthe implicitassumptionthat whatisbeingexchangedis similartoinputandoutput parametersofprogram invocations Thisapproachmakesitvery difficulttouseSOAPfor exchangingcomplexdata typesthatcannotbeeasily translatedtoXML(andthere isnoreasontodoso): images,binaryfiles, documents,proprietary representationformats, embeddedSOAPmessages, etc.

From SOAP Version 1.2 Part 0: Primer.

W3C December 2002 <env:Body> <p:itinerary xmlns:p="http://.../reservation/travel"> <p:departure> <p:departing>New York</p:departing> <p:arriving>Los Angeles</p:arriving> <p:depDate>2001-12-14</p:depDate> <p:depTime>late afternoon</p:depTime> <p:seatPreference>aisle</p:seatPreference> </p:departure> <p:return> <p:departing>Los Angeles</p:departing> <p:arriving>New York</p:arriving> <p:depDate>2001-12-20</p:depDate> <p:depTime>mid-morning</p:depTime> <p:seatPreference/> </p:return> </p:itinerary> </env:Body>

Gustavo Alonso, D-INFK. ETH Zrich.

38

Apossiblesolution

ThereisaSOAPmessageswith attachmentsnoteproposedin 11.12.02thataddressesthis problem ItusesMIMEtypes(likee mails)anditisbasedin includingtheSOAPmessage intoaMIMEelementthat containsboththeSOAP messageandtheattachment (seenextpage) Thesolutionissimpleandit followsthesameapproachas thattakeninemailmessages: includeareferenceandhave theactualattachmentatthe endofthemessage TheMIMEdocumentcanbe embeddedintoanHTTP requestinthesamewayasthe SOAPmessage

Problemswiththisapproach: handlingthemessageimplies draggingtheattachmentalong, whichcanhaveperformance implicationsforlargemessages scalabilitycanbeseriously affectedastheattachmentis sentinonego(nostreaming) notallSOAPimplementations supportattachments SOAPenginesmustbe extendedtodealwithMIME types(nottoocomplexbutit addsoverhead) Therearealternativeproposals likeDIMEofMicrosoft(Direct InternetMessageEncapsulation) andWSattachments

Gustavo Alonso, D-INFK. ETH Zrich.

39

AttachmentsinSOAP
From SOAP Messages with Attachments. W3C Note 11 December 2000

MIME-Version: 1.0 Content-Type: Multipart/Related; boundary=MIME_boundary; type=text/xml; start="<claim061400a.xml@claiming-it.com>" Content-Description: This is the optional message description. --MIME_boundary Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <claim061400a.xml@claiming-it.com>
SOAP Message <?xml version='1.0' ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> .. <theSignedForm href="cid:claim061400a.tiff@claiming-it.com"/> .. Reference </SOAP-ENV:Body> </SOAP-ENV:Envelope> --MIME_boundary Content-Type: image/tiff Content-Transfer-Encoding: binary Content-ID: <claim061400a.tiff@claiming-it.com> ATTACHMENT

...binary TIFF image... --MIME_boundary


Gustavo Alonso, D-INFK. ETH Zrich. 40

Theproblemswithattachments

Attachmentsarerelativelyeasytoincludeinamessageandall proposals(MIMEorDIMEbased)aresimilarinspirit Thedifferencesareinthewaydataisstreamedfromthesendertothe receiverandhowthesedifferencesaffectefficiency MIMEisoptimizedforthesenderbutthereceiverhasnoideaof howbigamessageitisreceivingasMIMEdoesnotincludemessage lengthforthepartsitcontains thismaycreateproblemswithbuffersandmemoryallocation italsoforcesthereceivertoparsetheentiremessageinsearchfor theMIMEboundariesbetweenthedifferentparts(DIMEexplicitly specifiesthelengthofeachpartwhichcanbeusetoskipwhatisnot relevant) AlltheseproblemscanbesolvedwithMIMEasitprovidesmechanisms foraddingpartlengthsanditcouldconceivablybeextendedtosupport somebasicformofstreaming Technically,thesearenotveryrelevantissuesandhavemoretodowith marketingandcontrolofthestandards Therealimpactofattachmentsliesonthespecificationoftheinterface ofWebservices(howtomodelattachmentsinWSDL?)
41

Gustavo Alonso, D-INFK. ETH Zrich.

Practical uses of SOAP

SOAPandtheclientservermodel

ThecloserelationbetweenSOAP,RPCandHTTPhastwomainreasons: SOAPhasbeeninitiallydesignedforclientservertypeofinteraction whichistypicallyimplementedasRPCorvariationsthereof RPC,SOAPandHTTPfollowverysimilarmodelsofinteractionthatcan beveryeasilymappedintoeachother(andthisiswhatSOAPhasdone) TheadvantagesofSOAParisefromitsabilitytoprovideauniversalvehicle forconveyinginformationacrossheterogeneousmiddlewareplatformsand applications.Inthisregard,SOAPwillplayacrucialroleinenterprise applicationintegrationeffortsinthefutureasitprovidesthestandardthat hasbeenmissingalltheseyears ThelimitationsofSOAParisefromitsadherencetotheclientservermodel: dataexchangesasparametersinmethodinvocations rigidinteractionpatternsthatarehighlysynchronous andfromitssimplicity: SOAPisnotenoughinarealapplication,manyaspectsaremissing

Gustavo Alonso, D-INFK. ETH Zrich.

43

AfirstuseofSOAP

database management system

Someofthefirstsystemsto incorporateSOAPasanaccess methodhavebeendatabases.The processisextremelysimple: client astoredprocedureis essentiallyanRPCinterface Webservice=stored procedure IDLforstoredprocedure= translatedintoWSDL calltoWebservice=useSOAP enginetomaptocalltostored procedure Thisusedemonstrateshowwell SOAPfitswithconventional middlewarearchitecturesand interfaces.Itisjustanatural extensiontothem

Web services interfaces HTTP engine XML mapping HTTP wrapping SOAP engine stored procedure API
Stored procedure interfaces

database
resource manager

external application

Gustavo Alonso, D-INFK. ETH Zrich.

Database stored procedure engine


44

SOAPSummary

SOAP,initscurrentform,providesa basicmechanismfor: encapsulatingmessagesintoan XMLdocument mappingtheXMLdocument withtheSOAPmessageintoan HTTPrequest transformingRPCcallsinto SOAPmessages simplerulesonhowtoprocess aSOAPmessage(rulesbecame morepreciseand comprehensiveinv1.2ofthe specification) SOAPisaverysimpleprotocol intendedfortransferringdatafrom onemiddlewareplatformto another.Inspiteofitsclaimstobe open(whicharetrue),current specificationsandimplementations areverytiedtoRPCandHTTP.

SOAPtakesadvantageofthe standardizationofXMLtoresolve problemsofdatarepresentation andserialization(itusesXML Schematorepresentdataanddata structures,anditalsorelieson XMLforserializingthedatafor transmission).AsXMLbecomes morepowerfulandadditional standardsaroundXMLappear, SOAPcantakeadvantageofthem bysimplyindicatingwhatschema andencodingisusedaspartofthe SOAPmessage.Currentschema andencodingaregenericbutsoon therewillbeverticalstandards implementingschemasand encodingtailoredtoaparticular applicationarea(e.g.,theefforts aroundEDI)

Gustavo Alonso, D-INFK. ETH Zrich.

45

Вам также может понравиться