Presentation on theme: "SOAP. Service Broker Basic SOAP Message Exchange Service Consumer Service Provider http transport SOAP message WSDL describing service SOAP message http."— Presentation transcript:
Service Broker Basic SOAP Message Exchange Service Consumer Service Provider http transport SOAP message WSDL describing service SOAP message http transport client service registry find publish DESCRIBE INVOKE SOAP SenderSOAP Receiver SOAP Sender SOAP Receiver
SOAP Body SOAP Message SOAP header SOAP envelope Header block Header data Header data Header data Body child element
SOAP Building Blocks A SOAP message is an XML document with the following elements –A required envelope Identifies XML document as a SOAP message –An optional header Contains header information –A required body element with call and response information –An optional fault element Information about errors that could occur
Sample SOAP Message 1 2001-06-22T14:00:00-05:00 Pick up Mary at school at 2pm
SOAP Envelope Element Required field – tells that this XML document is a SOAP message Encoding style attribute – used to define data types used in the document <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">... Message information goes here...
SOAP Header Contains application specific information (e.g. authentication, payment, etc.) Optional field, but if present, must be the first child of the envelope element <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <m:Trans xmlns:m=http://www.w3schools.com/transaction/http://www.w3schools.com/transaction/ soap:mustUnderstand="1">234......
SOAP Header – Contd. The previous example contains –A Trans element, which is an actor –mustUnderstand attribute of 1 –A value of 234, which denotes an encoding style Actor attribute –Message may pass multiple nodes – we need to denote who needs to act on it mustUnderstand – whether a header entry is madatory or optional for the recipient to process
SOAP Body Actual message <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> Apples
SOAP Fault Element Error message from a SOAP message is carried inside a fault element Must appear as a child element of the body element Has the following subelements: –Faultcode - identifies the fault –Faultstring – human readable explanation of the fault –Fault-factor – what caused the fault –Details -- application specific information
A More Involved Example buyer seller message broker RFQ QuoteResponse Award
Remote Procedure Calls To invoke RPC –Address of target SOAP node –Method name –Identities and values of arguments –Separation of arguments identifying target of RPC versus data Plus values of properties for binding (e.g. GET, POST) –Optional header data
SOAP Faults Place faults inside env:Body elements In single env:Fault env:Node identifies node which generated fault Absence indicates “ultimate recipient” env:Code env:Value env:Subcode env:Reason env:Text env:Detail Application specific
SOAP Fault Example env:Sender rpc:BadArguments Processing error Chyba zpracování Unknown destination 999
SOAP Processing Model SOAP messages are sent from one sender node passing through zero or more intermediaries Three roles –next: each SOAP intermediary or end destination must act in this role –none: SOAP nodes must not act in this role –ultimateReceiver: destination acts in this role Header blocks targeted to specific roles using Role attribute If mustUnderstand=“true” SOAP receiver must understand or generate SOAP fault Header blocks processed by intermediaries are generally removed before forwarding –Override with relay attribute –Allows targeting of headers to specific intermediaries (but mustUnderstand would then generally be turned off)
SOAP Processing: Header Blocks, MustUnderstand and Relay...............
SOAP Remoting Architecture Server object implementation application level Client application code Server skeleton XML unmarshaller Client stub XML marshaller TCP/IP socket remoting architecture level wire protocol level http protocol http server http server body envelope header