SOAP Message Exchange Patterns

SOAP Message Exchange Patterns

SOAP Message Exchange Patterns • SOAP is defined as a one-way message transmission protocol, however real applications use various message exchange patterns (MEP) to communicate SOAP messages. • A familiar example of a MEP is that which occurs between a Web browser and a Web server when exchanging HTML embedding in an HTTP message Internet HTTP Request <HTML> </HTML> HTTP Response Web Browser Web Server HTTP Request-Response SOAP Message Exchange Patterns • The MEPs that can be used depend on what the underlying transport protocol supports. • SOAP was designed to be independent of the underlying protocol, so it only defines SOAP as one-way. • However, the SOAP designers fully expect SOAP messages to be combined in various exchange patterns, and therefore, they abstractly describe two MEPs in the SOAP specification: Request-Response and SOAP Response <SOAP> <XML> SOAP Request Message </XML> </SOAP> Sender Receiver <SOAP> SOAP Response Message <XML> </XML> </SOAP> Request-Response MEP SOAP Message Exchange Patterns Non-SOAP Message Sender Receiver <SOAP> SOAP Response Message <XML> </XML> </SOAP> SOAP Response MEP • Other forms of MEPs are One-Way, Notification, Single Request/Multiple Response, and Solicit-Response. • One-Way and Request-Response are the most popular MEPs in use today. Both are supported by HTTP, which is the most commonly used method for transporting SOAP messages. SOAP Message Structure • A SOAP message is simply an XML document with it’s own XML schema, XML namespaces, and processing rules. • The XML document that defines a SOAP message is composed of the following four elements: • Envelope (mandatory) – Root of the XML document. • Header (optional) – An extension mechanism that can be used to pass application-specific information not contained in the message itself. • Body (mandatory) – Contains the application data that is being transported between applications. • Fault (optional) – Used to report errors back to a SOAP sender. Analogous to an Exception in Java. SOAP Message Structure, cont. •The SOAP Envelope is a package for data (a message) that is transported from a sender node to a receiver node. <soap:Envelope> <soap:Envelope> <soap:Header> <soap:Header> <…> <…> </soap:Header> </soap:Header> <soap:Body> <soap:Body> <…> <soap:Fault> </soap:Body> <…> </soap:Fault> </soap:Envelope> </soap:Body> Normal SOAP </soap:Envelope> Message SOAP Message with a Fault Structure of a SOAP Message with and without a Fault SOAP Message Structure, cont. • Besides XML text data, SOAP can also transmit binary data. This is often done using XML references to Multipurpose Internet Mail Extensions (MIME) in HTTP. POST /aPostExample HTTP/1.1 Host: www.example.com Content-Type: Multipart/Related; ... Content-Length: XXX HTTP Headers <?xml version=”1.0" encoding=”UTF-8"?> <soap:Envelope> <soap:Body> <xml> SOAP Message ... </xml> </soap:Body> </soap:Envelope> Refers To E01DGkj4DtE/NWEDBidw3/DKB4dKLEW90// DIGEi45dEICG45IOl/DaIkgkeislIODe93 ... Attachments (possibly KIIx4kIELO30EGBDGIEBiide93w4IDKOl23KIL GIF, JPEG, PDF, etc) DGKED45kelsqiud412jkIWEPOWJAGEl2KI ... SOAP in HTTP Message with MIME Attachments XML Namespaces in SOAP • XML namespaces are used in SOAP to eliminate ambiguity (prefixes help distinguish between elements or attributes with the same name), provide versioning and processing control, and support modularity. • The SOAP XML elements are defined in the SOAP XML schema. The namespace for the SOAP schema is: – (version 1.1) http://schemas.xmlsoap.org/soap/envelope – (version 1.2) http://www.w3.org/2003/05/soap- envelope • The difference between the SOAP 1.1 and 1.2 namespace is an example of versioning. • Different XML namespaces can be used for the different parts of the SOAP message (SOAP schema elements, header blocks, and XML in the Body), thus code that processes one part can change while the code that processes the other parts can remain the same (modularity). XML Namespaces in SOAP, cont. • The SOAP schema requires that local elements (including their attributes) be fully qualified via the use of prefixes or default namespaces. • Additionally the WS-I BP requires that all local elements within the SOAP Body be fully qualified as well. • The local elements of header blocks may be qualified or unqualified, although the best practice is to qualify them. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsu="…"> <soap:Body wsu:Id="Body"> <po:purchaseOrder xmlns:po="http://yourbusiness/PO"> … </po:purchaseOrder> </soap:Body> </soap:Envelope>.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us