2Introduction to SOAP What is SOAP (_________ Object Access Protocol)? SOAP is a key element of Microsoft's .NET architectureSOAP is a communication protocolSOAP is for communication between applicationsSOAP is a format for sending __________SOAP is designed to communicate via InternetSOAP is platform independentSOAP is language independentSOAP is based on _______SOAP is simple and extensibleSOAP allows you to get around firewallsSOAP will be developed as a _____ standard
3SOAP SyntaxA SOAP message is an ordinary XML document containing the following elements:A required __________ element that identifies it as a SOAP messageAn optional _________ element that contains header informationA required ______ element that contains call and response informationAn optional _______ element that provides information about errors that occurred while processing the message
4Syntax RulesAll the elements above are declared in the default namespace for the SOAP envelope:The default namespace for SOAP encoding and data types is:Here is a good definition of a namespace.A SOAP messageMUST be encoded using _____MUST use the SOAP Envelope namespaceMUST use the SOAP Encoding namespacemust NOT contain a _____ referencemust NOT contain XML Processing Instructions
6SOAP Envelope ElementThe required SOAP Envelope element is the ______ element of a SOAP message.A SOAP message must always have an Envelope element associated with the ____________ "http://www.w3.org/2001/12/soap-envelope".If a different namespace is used, the application must generate an error and ________ the message.The SOAP encodingStyle attribute is used to define the data types used in the document.This attribute may appear on any SOAP element, and it will apply to that element's contents and all ______ elements.
7SOAP Header ElementThe optional SOAP Header element contains application-specific information about the message.If the Header element is present, it must be the first child element of the Envelope element.All immediate child elements of the Header element must be namespace-qualified.SOAP defines three attributes in the default namespace: actor, mustUnderstand, and ______________.The attributes defined in the SOAP Header define how a recipient should process the SOAP message.
8Sample Header Element<soap:Header><m:Transxmlns:m=“http://www.w3schools.com/transaction/”soap:actor="http://www.w3schools.com/appml/“soap:mustUnderstand="1">234</m:Trans></soap:Header>The SOAP mustUnderstand attribute is used to indicate whether a header entry is mandatory or optional for the recipient to process.The SOAP actor attribute may be used to address the Header element to a particular __________.
9SOAP Body Element (1)The SOAP Body element contains the actual SOAP message.<?xml version="1.0"?><soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body><m:GetPrice xmlns:m="http://www.w3schools.com/prices"><m:Item>Apples</m:Item></m:GetPrice></soap:Body></soap:Envelope>
10SOAP Body Element (2) A SOAP response could look something like this: <?xml version="1.0"?><soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body><m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices"><m:Price>1.90</m:Price></m:GetPriceResponse> </soap:Body></soap:Envelope>
11SOAP Fault ElementAn error message from a SOAP message is carried inside a Fault element.If a Fault element is present, it must appear as a child element of the ______ element.The SOAP Fault element has the following sub elements:<faultcode> A code for identifying the fault<faultstring> A human readable explanation of the fault<faultactor> Information about who caused the fault<detail> Holds application specific error information related to the Body element
12SOAP HTTP BindingAfter establishing a connection, the client can send an HTTP request message to the server:POST /item HTTP/1.1Host:Content-Type: application/soap+xml; charset=utf-8Content-Length: 300The server then processes the request and sends an HTTP response back to the client.200 OKIn the example above, the server returned a status code of 200. This is the standard success code for HTTP.