Presentation on theme: "CIS 375—Web App Dev II SOAP. 2 Introduction to SOAP What is SOAP (_________ Object Access Protocol)? SOAP is a key element of Microsoft's.NET architecture."— Presentation transcript:
CIS 375—Web App Dev II SOAP
2 Introduction to SOAP What is SOAP (_________ Object Access Protocol)? SOAP is a key element of Microsoft's.NET architecture SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending __________ SOAP is designed to communicate via Internet SOAP is platform independent SOAP is language independent SOAP is based on _______ SOAP is simple and extensible SOAP allows you to get around firewalls SOAP will be developed as a _____ standard
3 SOAP Syntax A SOAP message is an ordinary XML document containing the following elements: A required __________ element that identifies it as a SOAP message An optional _________ element that contains header information A required ______ element that contains call and response information An optional _______ element that provides information about errors that occurred while processing the message
4 Syntax Rules All 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.namespace A SOAP message MUST be encoded using _____ MUST use the SOAP Envelope namespace MUST use the SOAP Encoding namespace must NOT contain a _____ reference must NOT contain XML Processing Instructions
5 Skeleton SOAP Message
6 SOAP Envelope Element The 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.
7 SOAP Header Element The 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.
8 Sample Header Element 234 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 __________.
9 SOAP Body ElementSOAP Body Element (1) The SOAP Body element contains the actual SOAP message. Apples
10 SOAP Body Element (2) A SOAP response could look something like this: 1.90
11 SOAP Fault Element An 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: A code for identifying the fault A human readable explanation of the fault Information about who caused the fault Holds application specific error information related to the Body element
12 SOAP HTTP Binding After establishing a connection, the client can send an HTTP request message to the server: POST /item HTTP/1.1 Host: Content-Type: application/soap+xml; charset=utf-8 Content-Length: 300 The server then processes the request and sends an HTTP response back to the client. 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: 300 In the example above, the server returned a status code of 200. This is the standard success code for HTTP.