• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

SOAP - the mustUnderstand Attribute

 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 3947
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ivan.

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

Regards,
Dan
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ivan.
 
My pie came with a little toothpic holding up this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic