The messages are typically transported using the HTTP protocol which is the protocol used to request/receive web pages from a web server to a browser. Web service can use other transport protocols however such as SMTP but HTTP is used in the vast majority of the cases. The message protocol used by web services is SOAP (Simple Object Access Protocol). Its XML encoded messaging protocol that is used to marshal the input parameters and return values of a web service method.
SOAP messages are messages formatted in XML the SOAP standard specifies what XML elements must be present in what order and what data types they can contain. A SOAP message is comprised of the following parts:
(a) A SOAP envelope
(b) An optional SOAP header and
(c) A SOAP body
In a web service interaction there is a total of two messages: first the client sends a SOAP message to the server invoking some method. After this method has executed the server returns a response which includes the return value of the method. For the first message sometimes referred to as the soap request message the SOAP body contains the name of the method the client wishes to call along with the methods input parameters. In the second message the SOAP response message the server sends back in the body the return value of the method. Even if there is no return value a message is still send back if nothing else to verify that the method executed.