===== SOAP Cheat Sheet ===== SOAP is a popular protocol for accessing a web service. My interest in this arose when I needed to schedule a web service using the Oracle Scheduler. This SOAP client had to be written from scratch using PL/SQL so I needed to become familiar with the protocol first. This is a summarized form of the [[http://www.w3schools.com/soap/default.asp| SOAP Tutorial]]. SOAP is an XML dialect so the [[XML Cheat Sheet]] might be useful and in particular the [[ xml_cheat_sheet#xml_namespaces | XML Namespaces section]] . For reference here are the [[http://www.w3.org/TR/soap/ | SOAP Specifications]] . * The **S**imple **O**bject **A**ccess **P**rotocol (SOAP) is a simple XML based protocol to let apps exchange information over HTTP. * SOAP is a W3C standard, the latest version is 1.2. SOAP is also a major part of .NET . ==== Messages ==== * A SOAP message * MUST contain an envelope root element * MAY contain a header element * MUST contain a body element * MAY contain a fault element * MUST use the SOAP Envelope and a SOAP Encoding namespaces. * This is a sample SOAP message. ... ... ... ==== Envelopes ==== * There are three attributes in the SOAP envelope namespace : * actor - URI of endpoint for which the element is intended * mustUnderstand - 0 or 1 to specify whether the receiver is obligated to recognize the element or not. * encodingStyle * The SOAP Envelope namespace for elements must always be http://www.w3.org/2001/12/soap-envelope . * One possible SOAP Encoding namespace for SOAP encoding and data types is http://www.w3.org/2001/12/soap-encoding . ==== Fault Elements ==== The optional SOAP Fault element is used to hold error and status information for a SOAP message. It can have the following sub-elements : * faultcode - A code for identifying the fault. The faultcode must be one of the following : * VersionMismatch - Found an invalid namespace * MustUnderstand - A required element was not understood * Client - There was an error in the message * Server - There was an error on the server processing the message * faultactor - The endpoint that caused the fault * faultstring - A human-readable explanation * details - Application-specific error info