SOAP is an XML based message called SOAP envelope and has following essential
elements
Envelop name space - This name space does not directly point to a
dtd file but to a URL alias like http://www.w3.org/2003/05/soap-envelope
Envelop encoding type this element specifies the SOAP encoding
rules to be followed. This name space does not directly point to a dtd
file but to a URL alias like http://schemas.xmlsoap.org/soap/encoding/
Envelope name Name of the SOAP message
Header Meta information of the Envelop, This element is optional
Body Application data container, This element is required
Lets look at the XML below
<soap:Envelope
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/
soap:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"
>
<soap:Header>
<!This is an optional block, header content here -->
</soap:Header>
<soap:Body>
<!This is a required block, request or response data comes here-->
</soap:Body>
</soap:Envelope>
Let us look at a simple SOAP request-response login authentication routine.
There is no Header element, remember!! Its optional
lg:Login is the method we are invoking on a service hosted at urn MyServer.
The service "urn:MyServer" can host a lot of other methods also.
Example a movie information service can host other methods like lg:MovieList,
lg:TheatreList etc