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 Clarification on mustUnderstand and role attributes of SOAP header blocks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Clarification on mustUnderstand and role attributes of SOAP header blocks " Watch "Clarification on mustUnderstand and role attributes of SOAP header blocks " New topic
Author

Clarification on mustUnderstand and role attributes of SOAP header blocks

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

Hi All,

While reading through the SOAP nodes and header blocks, I read through mustUnderstand and role attributes of SOAP envelope schema. It is mentioned that applications can define their own roles as an addition to the standard next, none, ulitmateReceiver. Does anybody come across such examples? I tried to look for one, but was not successful.

Also, assume that a header block bears the role as "next" and mustUnderstand = "1" in such cases, the next available node in path, should either process it or generate a fault. If it generates a fault, a SOAP fault is sent back to the sender. If it processes the header, then it would remove that header block and fowards the modified SOAP message to the next node. Is my understanding correct so far?

In the usecase of fault generation, I think that particular SOAP fault would again go through all the nodes defined in its path before reaching the original sender. Is this true ?

I'm adding another question to my original post. Under SOAP role attribute description (http://www.w3.org/TR/soap12-part1/#soaprole), it is mentioned that


SOAP senders SHOULD NOT generate, but SOAP receivers MUST accept, the SOAP role attribute information item with a value of "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver".


Does the above statement mean, that a SOAP sender should not explicitly indicate the role as "ultimateReciever" and if no role mentioned, then it implies "ultimateReceiver". Can an intermediary set the role to "ultimateReceiver", if not the original sender? Is there any logical reason for not allowing the sender to specify the role as "ultimateReceiver".


If relaying the message, a SOAP intermediary MAY omit a SOAP role attribute information item if its value is "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"


If a sender is NOT permitted to set "ultimateReceiver", why would intermediaries would see the attribute value as "ultimateReceiver".

Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
First, I suspect that examples of headers being passed through intermediaries are not common due to this being an uncommon scenario. It is also a more complicated scenario. In my work, I see mostly direct communication between a client and a service.
Kumar Raja wrote:Also, assume that a header block bears the role as "next" and mustUnderstand = "1" in such cases, the next available node in path, should either process it or generate a fault. If it generates a fault, a SOAP fault is sent back to the sender. If it processes the header, then it would remove that header block and fowards the modified SOAP message to the next node. Is my understanding correct so far?

Yes.
First note: As far as I remember, the direction of a fault message is the reverse of the direction of the message that caused the fault. Thus the fault would be sent back to the previous intermediary SOAP node, if there is such a node, not directly to the originator of the request.
Second note: A header block must be removed, but may be re-inserted by a SOAP node processing the header block. This can be seen as the header block being modified by the node.

An advice: Try posting fewer questions in each post. Perhaps one or two questions, at most. I feel it will become easier to answer such posts.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

Thanks for the answers Ivan.


Ivan Krizsan wrote:Hi!
An advice: Try posting fewer questions in each post. Perhaps one or two questions, at most. I feel it will become easier to answer such posts.
Best wishes!


Also, for sure I will keep this in mind. I knew that most of my posts would usually have multiple questions, because I did not want to stretch my questions over multiple posts for cohesivness. But never realized that, it may reduce the readability. I will keep your advise in mind, in my next posts.
 
jQuery in Action, 2nd edition
 
subject: Clarification on mustUnderstand and role attributes of SOAP header blocks