SOAP Messaging SOAP: Simple Object Access Protocol Blue soap bars in a soap dish Example POST /LocalApp HTTP/1.0 Host: www.silosix.com Content-Type: text/xml; charset="utf-8" Content-Length: 328 SOAPAction: "ImagesServerUp" PNG SOAP BINDINGS POST /LocalApp HTTP/1.0 Host: www.silosix.com Content-Type: text/xml; charset="utf-8" Content-Length: 328 SOAPAction: "ImagesServerUp" POST = Transport for the Message /LocalApp = Destination for the message HTTP/1.0 = HTTP Version Host: = Server sending message to Content-Type: Always 'text/xml' charset = Almost always "utf-8" Content-Length = number of characters in the message payload SOAPAction: ImagesServerUp = URI indicating purpose of the request. ImagesServerUp could tell the receiving server to check on the Images Server before doing some task. If the Images Server is down, fail or send an error message. SOAP Envelope PNG Namespaces Namespaces are used to keep messages contained and allows for handling of duplicate element and attribute names in an application by 'compartamentalizing' them in their own package. SOAP namespaces come in the form of xmlns :id="some URI" So that in our message the namespace is "ImagesServer" and we assign it the identifier 'i': xmlns:i="ImagesServer" And the namespace has two elements defined as i:GetMostPopularImage and i:ImageType: i:GetMostPopularImage i:Type PNG ImagesServer GetMostPopularImage Type Without the identifier, the message could be constructed as well and the default namespace of "ImagesServer" will be used: PNG One advantage to using identifiers is to increase readability and to allow for multiple namespaces in a single message. Below ImagesServer(i) will look up a file type of PNG and the ThumbsServer(i2) will pull the 'Medium' sized thumbnail. PNG120000PNG Medium Envelope Element The SOAP-ENV:Envelope element is the top-most element in the XML message and all other elements reside within this element. Required components include the xmlns namespace declaration, and commonly also has an 'encodingStyle' attribute. .. .. Header Element The Header element is optional and must be named "Header" and namespace qualified with the SOAP-ENV identifier. The 'actor' attribute notifies the receiving server where to send the request to first - if present. Proxies are commonly used to parse messages, where they came from, and what they're for before sending the message to the final destination. In this case, username could communicate the user who is making the request to determine access rights or to log the activity. AppServer would use 'username' to peform these functions.