aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes when to use soap:mustUnderstand= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "when to use soap:mustUnderstand="1" " Watch "when to use soap:mustUnderstand="1" " New topic
Author

when to use soap:mustUnderstand="1"

Shankar sanjay
Ranch Hand

Joined: Sep 14, 2009
Posts: 115
Hi,

Could you please provide some info, when to use soap:mustUnderstand="1" (in real time example)

Everywhere given comments like, "it will be in header and server has to understand when value is 1", if server cannot understand then it has to generate fault. these comments are not much clear.

Thanks.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I'll give it a try, though I am not sure I can make it simpler.
Let's say I have four nodes (computers) A, B, C and D.
A client is running on node A, a server on node D. Finally, B and C are intermediary nodes; B passes messages on to C and C on to D.
If the client sends out a header block targeted at node C with the mustUnderstand attribute set to 0, then the client cannot know whether node C chooses to process the message or not.
If the client sends out a header block targeted at node B with the mustUnderstand attribute set to 1 and the client does not receive a fault, then the client can be sure that node B has processed the header block.
The mustUnderstand attribute can be used to force a node to process a header block. This is good if, for instance, the header block contain information that must reach the node.
On the other hand, there may be information that is not essential to the intermediary node. Then mustUnderstand can be set to 0, which allows the node to ignore the header block.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Ravi Uppala
Greenhorn

Joined: Oct 18, 2011
Posts: 1

Yes that's right. If mustunderstand attribute is 1, any targeted node must process that header if not able to process that header it will generate faultCode "mustUnderstand" and send it to the client.
This is useful in case of implementing security and other meta services to the webservice. we can same receiver act as ultimate receiver and also other role like "Authetication Processor". we can put header info like userId and password for processing by this Authentication Processor, so when it is successfuly processed it will deliver to the real webservice otherwise generate a fault and send it to the client.

Most of the times developers combine authentication in webservice itself but best practice is to have seperate code block and targeted by header.

I hope this gives some more information on header.
Shankar sanjay
Ranch Hand

Joined: Sep 14, 2009
Posts: 115
Nice explanation, thank You both
 
 
subject: when to use soap:mustUnderstand="1"
 
Similar Threads
Question regarding MZ notes
how does the program start?
Server Disconnection
SOAP mustUnderstand Attribute for SOAP 1.2
Getting error while calling the .net web service from java code.