Presentation is loading. Please wait.

Presentation is loading. Please wait.

SOAP (Simple Object Access Protocol) Knarig Arabshian Department of Computer Science Columbia University April 24, 2002.

Similar presentations


Presentation on theme: "SOAP (Simple Object Access Protocol) Knarig Arabshian Department of Computer Science Columbia University April 24, 2002."— Presentation transcript:

1 SOAP (Simple Object Access Protocol) Knarig Arabshian Department of Computer Science Columbia University knarig@cs.columbia.edu April 24, 2002

2 Overview What is SOAP? Details of the protocol SOAP and SIP Emergency Notification Conclusion References

3 What is SOAP?

4 What is SOAP? Lightweight protocol used for exchange of messages in a decentralized, distributed environment Facilitates interoperability in a platform- independent manner Used for Remote Procedure Calls W3C note defines the use of SOAP with XML as payload and HTTP as transport, but other transport protocols can be used such as SMTP and SIP.

5 Advantages of SOAP Uses HTTP which is widely used and scalable Wide remote system interoperability Flexible for growth because of XML properties It but can be used for RPC.

6 Disadvantages of SOAP No good way to describe the serialization pattern (XML schema is optional at this point) Parsing of SOAP packet and mapping to objects reduces performance Doesn’t implement security because it is a wire protocol—relies on HTTP

7 SOAP Elements Envelope (mandatory) Top element of the XML document representing the message Header (optional) Determines how a recipient of a SOAP message should process the message Adds features to the SOAP message such as authentication, transaction management, payment, message routes, etc… Body (mandatory) Exchanges information intended for the recipient of the message. Typical use is for RPC calls and error reporting.

8 SOAP Elements SOAP Encoding Envelope package Header/Body pattern Similar to how HTTP works Header Body

9 Simple Example 345 3 4 c = Add(n1, n2)

10 SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345 3 4

11 SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”>...etc... Scopes the message to the SOAP namespace describing the SOAP envelope Establishes the type of encoding that is used within the message (the different data types supported)

12 SOAP Request...etc... 1234 3 4...etc... Qualifies transId Defines the method

13 SOAP Response <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345 7

14 SOAP Response <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345 7 Response typically uses method name with “Response” appended

15 SOAP Fault Used to carry error and/or status information within a SOAP message Appears within the SOAP body Defines the following: faultcode (mandatory) algorithmic mechanism for identifying the fault defined in the SOAP spec Faultstring (mandatory) human readable explanation of the fault

16 SOAP Fault faultactor (optional) information about who caused the fault to happen URI value identifying the source Detail error information related only to the Body element. if not present then indicates that the fault is not related to the Body element.

17 SOAP Fault Example <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> SOAP-ENV:Server Internal Application Error 794634 Divide by zero

18 SOAP Encoding Based on a simple type system that has common features with programming languages and databases Types are either simple (scalar) or compound which is a composite of several parts An XML schema which is consistent with this type system can be constructed Use of schemas is encouraged but NOT required

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

20 Structures typedef struct { char author[64]; char title[200] int year; } Book; Book crimAndPunishment; B = Publish(crimeAndPunishment) <m:Publish xmlns:m=http://a.com/Publishinghttp://a.com/Publishing xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/”> Fyodor Dostoevsky Crime and Punishment 1917

21 XML Schemas Defines the structure, content and semantics of XML documents Simple types Integers, strings, floats, time, etc. Compound (complex) types Arrays, structures

22 Example of XML Schema Fyodor Dostoevsky Crime and Punishment 1917

23 HTTP Request POST /Calculator.pl HTTP/1.0 Host: www.a.com Accept: text/* Content-type: text/xml Content-length: nnnn SOAPAction: “http://www.a.com/Calculator#Add” {CR}{LF} <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345 3 4

24 HTTP/1.0 200 OK Content-type: text/xml Content-length: nnnn {CR}{LF} <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345 7 HTTP Response

25 SOAPAction The SOAPAction HTTP request header field can be used to indicate the intent of the SOAP HTTP request. Used by servers, such as firewalls, to appropriately filter SOAP request messages in HTTP. If value is empty string (""), intent of the SOAP message is provided by the HTTP Request-URI. No value means that there is no indication of the intent of the message.

26 SOAPAction POST /Calculator.pl HTTP/1.0 Host: www.a.com Accept: text/* Content-type: text/xml Content-length: nnnn SOAPAction: “http://www.a.com/Calculator#Add” {CR}{LF} <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345...etc... SOAPAction Intent

27 SOAP and SIP

28 SOAP and SIP Emergency Notification SIP (Session Initiation Protocol) is a text-based signaling protocol used to establish multimedia sessions on the Internet. Similar to HTTP and SMTP Extended to support event notification using SUBSCRIBE and NOTIFY methods Send a NOTIFY message with SOAP payload Body of the SOAP message will invoke a remote procedure relevant to the particular emergency event Use XML Schema to specify different emergency events handled and parameters needed

29 SOAP and SIP

30 SOAP and SIP NOTIFY sip:knarig@128.59.19.194:5063 SIP/2.0 Via: SIP/2.0/UDP 128.59.19.194:5063 CSeq: 3 NOTIFY Contact: sip:knarig@128.59.19.194:5063 From: sip:cisalpino.cs.columbia.edu:5063 Call-Info: www.cs.columbia.edu/~knarig Date: Wed, 24 Apr 2002 14:57:05 GMT Content-Type: application/soap Call-ID: 461662663@128.59.19.194 Event: emergency To: sip:knarig@cs.columbia.edu Content-Length: 494 Mudd smoke

31 Columbia SIP user agent (sipc) Media Audio, video, text, white board Screen sharing Shared web browsing Advanced Presence, instant messaging Conference control Emergency notification and handling Device control

32 Columbia SIP user agent (sipc) Calls 911 by connecting to the local PSAP Receive emergency notification alerts from various event servers that user has subscribed to Invoke Emergency Services

33 Detailed overview of architecture 2) Generic emergency address: emergenycy@state.ny.us is added to sipc Fire Earthquake sos@leonia.nj.us Notification server (sipd) 3) Sipc contacts notification server and gets list of emergency events user can subscribe to 4) User subscribes to event it wants to be notified of 1) Event generators publish their events to notification server 5) Sipc gets XML schema reference from notification server that will generate a form which queries for the event’s properties. Sipc then updates its subscription to the notification server with the filtered expressions

34 Detailed overview of architecture 3)Sipc will process SOAP body and invoke the procedure call—such as flashing of lights Fire Earthquake Emergency@state.ny.us Notification server (sipd) 2) Sipd will process parameters of the fire and send a NOTIFY to sipc including SOAP body 1) Fire occurs and event generator notifies sipd

35 Example of Notification: Flashing of Lights serial port lamp X10 device Emergency event notification invokes multiple calls of the SIP “DO” method This causes the lamp (connected to the PC by an X10 device) to flash DO sip:lamp@cs.columbia.edu SIP/2.0 ….. turn lamp on

36 Conclusions SOAP is a scalable and widely used wiring protocol It is still not an industry standard and needs fine-tuning Using SIP and SOAP for emergency notification is simple and effective

37 References http://www.endurasoft.com/soap http://www.w3.org/TR/SOAP/ http://www.microsoft.com/mind/0100/soap/s oap.asp Scribner K., Stiver M.C., Understanding SOAP, Indianapolis, Indiana, 2000


Download ppt "SOAP (Simple Object Access Protocol) Knarig Arabshian Department of Computer Science Columbia University April 24, 2002."

Similar presentations


Ads by Google