Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simple Object Access Protocol. Web Services: SOAP2 Why Simple Object Access Protocol Light weight replacement for complicated distributed object technology.

Similar presentations


Presentation on theme: "Simple Object Access Protocol. Web Services: SOAP2 Why Simple Object Access Protocol Light weight replacement for complicated distributed object technology."— Presentation transcript:

1 Simple Object Access Protocol

2 Web Services: SOAP2 Why Simple Object Access Protocol Light weight replacement for complicated distributed object technology Originally for BizTalk ( Microsoft/UserLand/Developmentor ) Now a W3C standard Based on XML and HTTP

3 Web Services: SOAP3 Port vs Web Server External Application External Application External Application TCP Internal Service Internal Service Internal Service

4 Web Services: SOAP4 Port vs Web Server External Application External Application External Application TCP Internal Service Internal Service Internal Service Web Server XML payload “XML-RPC” Port 80? SOAP is not restricted to port 80

5 Web Services: SOAP5 POST /Temperature HTTP/1.1 Host: www.weather.com Content-Type: text/xml Content-Length: SOAPAction: “urn:StockQuote#GetQuote” … HTTP Header XML Payload (SOAP request) Soap Extensions SOAP over HTTP Request example

6 Web Services: SOAP6 HTTP/1.1 200 OK Content-Type: text/xml Content-Length: … SOAP over HTTP Response example HTTP Header XML Payload (SOAP response)

7 Web Services: SOAP7 SOAP Example: Request Fast Food Nation

8 Web Services: SOAP8 SOAP Example: Response 34.5

9 Web Services: SOAP9 SOAP Example: Error 0x800700E Unknown book

10 Web Services: SOAP10 SOAP Message A SOAP message is contained within an XML “envelope”, complete with a Header and Body SOAP Envelope SOAP Header (optional) SOAP Body “payload”

11 Web Services: SOAP11 SOAP Message with Binary Attachments A SOAP message can also contain binary attachments using MIME encoding SOAP Envelope SOAP Header (optional) SOAP Body “payload” MIME Header Root Body Part MIME Boundary Body Part MIME Boundary Attachment

12 Web Services: SOAP12 SOAP Structure Envelope contains Header Body Header is optional Out-of-band information such as…  Authentication information  Message routes  Logging  Transaction flow Body contains XML body of RPC call SOAP Envelope SOAP Header Header Block... SOAP Body Body Block...

13 Web Services: SOAP13 SOAP Example <n:alertcontrol xmlns:n="http://example.org/alertcontrol"> 1 2001-06-22T14:00:00-05:00 Pick up Mary at school at 2pm

14 Web Services: SOAP14 XML Messaging in SOAP EDI: Electronic Document Interchange SOAP with EDI: XML documents “Document style SOAP” RPC: distributed computing, web services “RPC-style” SOAP: parameters and return values

15 Web Services: SOAP15 <m:transaction xmlns:m=“soap-transaction” s:mustUnderstand=“true”> 1234 Christopher Robin Accounting Pooh Bear Honey> 1 Pooh Stick Purchase Order in Document-Style SOAP

16 Web Services: SOAP16 RPC Messages Typically two messages SOAP Client SOAP Server Request Message Response Message

17 Web Services: SOAP17 An RPC-style SOAP Message public Float getQuote (String symbol); 1234 IBM

18 Web Services: SOAP18 SOAP Response 98.06

19 Web Services: SOAP19 SOAP Faults Client.Authentication Invalid credentials http://acme.com/

20 Web Services: SOAP20 Standard SOAP Fault Codes Version Mismatch MustUnderstand: specify which header blocks were not understood Server: error can’t be directly linked to the processing of the message Client: there is a problem in the message (e.g. invalid authentication credentials)

21 Web Services: SOAP21 SOAP Data Encoding One possible method of serializing data and encode them into XML Section 5 of the SOAP standard General rules

22 Web Services: SOAP22 Compound Values A compound value represents a combination of two or more accessors grouped as children of a single accessor Each accessor has a different name (structs) Joe Smith

23 Web Services: SOAP23 Arrays An array is a compound value in which the accessors have the same name

24 Web Services: SOAP24 Multi-Referenced Accessor 111 First Street New York

25 Web Services: SOAP25 Express the Data Type of an Accessor Use the xsi:type attribute on each accessor, explicitly referencing the data type according to the XML Schema specification: John Doe Reference an XML Schema document that defines the exact data type of a particular element within its definition: John Doe Reference some other type of schema document that defines the data type of a particular element within its definition: John Doe

26 Web Services: SOAP26 SOAP Data Types Two alternate syntaxes for expressing instances of data types Anonymous accessor: 36 Anonymous because its name is its type rather than a meaningful id for the value Named accessor: 36

27 Web Services: SOAP27 Arrays int a[3] = {1, 2, 3}; b = Add([in]a); <m:Add xmlns:m=“http://a.com/Calculator” xmlns:SOAP-ENC= "http://schemas.xmlsoap.org/soap/encoding/”> 1 2 3

28 Web Services: SOAP28 By value: Add([in] int a, [in] int b); By reference : Square([in, out] int &a); Values and References 3 4 8

29 Web Services: SOAP29 Summary SOAP protocol: an XML encoding scheme to exchange information between web processes: Document style: XML documents RPC style: packing parameters in XML format Typically SOAP/HTTP, others are possible Low level in terms of process/service modeling


Download ppt "Simple Object Access Protocol. Web Services: SOAP2 Why Simple Object Access Protocol Light weight replacement for complicated distributed object technology."

Similar presentations


Ads by Google