Reputation: 3409
In sample soap XML request message, I noticed that there are soap envelope tag as
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
...
Is it okay to remove these tags? For example,change the soap message as,
<soapenv:Envelope>
<Header>
...
Is this standard that all soap message must have?
Thanks.
Upvotes: 0
Views: 7241
Reputation: 6749
The soap message is required, the namespace may be used by the receiving end to determine the version of the soap message. The namespace you are using, from what I understand, says this message follows Soap 1.1
standards. If you try to use Soap 1.2
features in that message, the server will most likely get confused.
Section 4.1.2 of the soap 1.1 standard
SOAP does not define a traditional versioning model based on major and minor version numbers. A SOAP message MUST have an Envelope element associated with the "http://schemas.xmlsoap.org/soap/envelope/" namespace. If a message is received by a SOAP application in which the SOAP Envelope element is associated with a different namespace, the application MUST treat this as a version error and discard the message. If the message is received through a request/response protocol such as HTTP, the application MUST respond with a SOAP VersionMismatch faultcode message (see section 4.4) using the SOAP "http://schemas.xmlsoap.org/soap/envelope/" namespace.
soap envelope in 1.1
soap envelope in 1.2
Upvotes: 2