The SOAP Envelope

The <Envelope> element is the mandatory root of every SOAP message. In addition, every <Envelope> has the following characteristics:

• It must reference the SOAP Envelope namespace ( x m l n s : SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/').

• It may contain a single <Header> element.

• It must contain exactly one <Body> element.

The full SOAP <Envelope> element produced by .NET Remoting typically looks like this:

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmIns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

xmIns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0"

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

Plenty of namespace identifiers are included in this code to scope various elements of the SOAP message. The first two attributes map the conventional alias identifiers xsi and xsd to the XML namepsaces http://www.w3.org/2001/XMLSchema-instance and http://www.w3.org/2001/XMLSchema, respectively. The xmlns:SOAP-ENC attribute maps the SOAP-ENC alias identifier to the SOAP 1.1 encoding schema. The xmlns:SOAP-ENV attribute maps the SOAP-ENV alias identifier to the SOAP 1.1 envelope schema. Later in this section, you'll see that most elements in the SOAP message use the namespace alias identifier SOAP-ENV for the elements and attributes defined in the <Envelope> element. Also note that the encodingStyle attribute indicates that the SOAP message follows the encoding rules specified in Section 5 of the SOAP 1.1 specification.

0 0

Post a comment