FYI....
If we insert the following code in the axis generated stub
the error org.apache.axis2.AxisFault: Must Understand check failed for
header will not occur
Iterator it = env.getHeader().examineAllHeaderBlocks();
while(it.hasNext())
{
SOAPHeaderBlock headerBlock=
(SOAPHeaderBlock)it.next();
headerBlock.setRole("http://www.w3.org/2003/05/soapenvelope/role/next");
}
References:
www.javapassion.com/webservices/SOAPProcessingModel.pdf
www.grid2004.org/spring2004/SOAP3.ppt
Thanks
Appu
-----Original Message-----
From: Appasamy Thirugnana [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2008 09:39
To: [EMAIL PROTECTED]
Subject: Must Understand check failed for header Exception
Please help me as I am struggling with this exception for long time
Thanks in advance
Appu
Hi,
In order to set soapenv:mustUnderstand="1"
I tried modifying the stub in my client the following manner while
adding header
if (messageHeader5 != null)
{
org.apache.axiom.om.OMElement omElementmessageHeader5 =
toOM(messageHeader5,
optimizeContent(
new javax.xml.namespace.QName(
"http://www.some.com/NewService.wsdl
<http://www.some.com/NewService.wsdl> ",
"Superset")));
addHeader(omElementmessageHeader5, env,true); ----->
Included the third parameter "true" to make mustUnderstand="1"
}
Now i am getting the evnevlope as expected with mustUnderstand="1"
but the request is not going out giving me the following exception
org.apache.axis2.AxisFault: Must Understand check failed for header
http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd
: MessageHeader
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
:486)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
InAxisOperation.java:343)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:389)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
xisOperation.java:211)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163
)
at com.new.service.NewServiceStub.NewService(NewServiceStub.java:220)
at TestService1.main(TestService1.java:107)
I found that the soap header needs to be processed and its
"isProcessed" to be set to true to avoid excpetion
and I tried in stub with following code for processing the header which
is going out
Iterator it = env.getHeader().examineAllHeaderBlocks();
while(it.hasNext())
{
SOAPHeaderBlock headerBlock=
(SOAPHeaderBlock)it.next();
headerBlock.setProcessed();
System.out.println("Processed:->"+headerBlock.isProcessed()+""); --->Its
giving "true"
}
Still I am getting the error. Please tell me is there any other way to
get rid of this issue.
Thanks
Appu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]