File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes SOAP - the mustUnderstand Attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "SOAP - the mustUnderstand Attribute" Watch "SOAP - the mustUnderstand Attribute" New topic
Author

SOAP - the mustUnderstand Attribute

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
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

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3178
    
    3
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".


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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

Joined: Jul 09, 2001
Posts: 1164
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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

Joined: Jul 09, 2001
Posts: 1164
Thank you Ivan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAP - the mustUnderstand Attribute
 
Similar Threads
Mustunderstand without actor attribute
MustUnderstand Attribute
Regarding SOAP header relay attribute
Did not get mustUnderstand - Error in SOAP Header
Invoke .NET Web Service using Java/Axis passing SoapHeader