Forums Register Login

SOAP - the mustUnderstand Attribute

+Pie Number of slices to send: Send
Good Day,

I'm not clear about the location of the mustUnderstand attribute. Is it only allowed in the SOAP header? I think Ivan's notes say that it can also be in the envelope and body elements ...

Regards,
Dan
+Pie Number of slices to send: Send
The SOAP mustUnderstand attribute should appear ONLY on elements within SOAP:Header element in order to be processed correctly by the node (intermediary).

Note, SOAP 1.2 allows values "0", "1", "true", "false", while SOAP 1.1 only "1" and "0".

WS-I BP 1.1 requires mustUnderstand be either "0" or "1".

+Pie Number of slices to send: Send
Hi!

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.
Best wishes!

P.S. Thanks for all the questions. They are good and forces me to review my notes once more!
+Pie Number of slices to send: Send
Thank you Mikalai and Ivan.

Ivan Krizsan wrote: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.



Looking at Schema for the SOAP/1.1 envelope (couldn't find the 1.2 version) that defines mustUnderstand as a global attribute.

Interestingly, it says -

removed default value from mustUnderstand attribute declaration



Thank you,
Dan
+Pie Number of slices to send: Send
Hi!

Dan Drillich wrote:
Looking at Schema for the SOAP/1.1 envelope (couldn't find the 1.2 version) that defines mustUnderstand as a global attribute.


Good research!
However, the SOAP 1.2 specification (http://www.w3.org/TR/2007/REC-soap12-part1-20070427/) says:


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).



In the SOAP 1.1 specification (http://www.w3.org/TR/2000/NOTE-SOAP-20000508), section 4.2 is on SOAP Headers. In section 4.2.1 it talks about header attributes:

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.
Best wishes!
+Pie Number of slices to send: Send
Thank you Ivan.

So, why doesn't the the schema itself define mustUnderstand as an attribute of the Header element?

Regards,
Dan
+Pie Number of slices to send: Send
Hi!

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.
Best wishes!
+Pie Number of slices to send: Send
Thank you Ivan.
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3650 times.
Similar Threads
BP 1.1 Clarification related to parts attribute of <soapbind:body> element.
Regarding SOAP header relay attribute
SOAP action and mustUnderstand attributes
Clarification on mustUnderstand and role attributes of SOAP header blocks
SOAP schema
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:01:45.