Dan Drillich wrote: I think Ivan's notes say that it can also be in the envelope and body elements ...
If it is this section you are thinking of, please read it again:
The mustUnderstande attribute is part of the same namespace as the Envelope, Body and Header elements of the SOAP schema.
It says that the attribute is part of a namespace to which the Envelope, Body and Header elements also belong.
This does not say anything about where in an XML document the attribute may appear - that has to be determined looking at the XML schema in question.
P.S. Thanks for all the questions. They are good and forces me to review my notes once more!
A SOAP sender generating a SOAP message SHOULD use the mustUnderstand attribute information item only on SOAP header blocks. A SOAP receiver MUST ignore this attribute information item if it appears on descendants of a SOAP header block or on a SOAP body child element information item (or its descendents).
The SOAP Header attributes defined in this section determine how a recipient of a SOAP message should process the message as described in section 2. A SOAP application generating a SOAP message SHOULD only use the SOAP Header attributes on immediate child elements of the SOAP Header element. The recipient of a SOAP message MUST ignore all SOAP Header attributes that are not applied to an immediate child element of the SOAP Header element.
Further down, in section 4.2.3 the mustUnderstand attribute is discussed. This leads me to believe that the mustUnderstand attribute is a SOAP Header attribute and, while being allowed to appear anywhere by the XML schema, is to be ignored if appearing outside the SOAP Header element.
Thus I have proved myself wrong - the XML schema will not tell you where the mustUnderstand attribute may or may not appear. Instead this information is to be found in the SOAP 1.1 and 1.2 specifications.
Dan Drillich wrote:
So, why doesn't the the schema itself define mustUnderstand as an attribute of the Header element?
Well, this is just a guess, since I wasn't one of the ones creating the schema:
I get the feeling that the mustUnderstand attribute perhaps was intended as being usable on different parts of a SOAP message in order to target the parts at different nodes in a chain of nodes processing messages.
Another guess (perhaps a better one) is that it is difficult to define an attribute that can be placed on any child element of the SOAP Header element without using a global attribute. The side effect is, as we already know, that the attribute indeed is global and, according to the XML schema alone, can be applied to any element in the schema.
Again, these are just my guesses and shouldn't be taken too seriously, if serious at all.