You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Guo Tianchong <gu...@nec-as.nec.com.cn> on 2008/12/04 08:06:46 UTC

[Axis2] How to resolve the "...Must Understand check.." exception for Response SOAP message

Dear Axis's master:

I'm a programer using Axis2 1.4.1 to develope a Web Service application.
Now, I have met a problem about the famous "Must Understand check".
But my case is a litter special.

The detail is that :

I used org.apache.axis2.client.OperationClient API to construct a custom
SOAP message and send it to my Web Service like this:

......
MessageContext outMsgCtx = new MessageContext();
outMsgCtx.setEnvelope(buildOutEnvelope());

Options opts = outMsgCtx.getOptions();
opts.setTo(TARGET_EPR);
opts.setAction("urn:download");

operationClient.addMessageContext(outMsgCtx);
operationClient.execute(true);
......

By the SOAP Monitor and server log, I could judged that the Web Service did work
and returned desired SOAP message.
One of my Response message header block included mustUnderstand
attributes, such as:

...
  <soap:Header>
    <xxx:ID soap:mustUnderstand="1">42</xxx:ID>
  </soap:Header>
...

#####
    Please NOTE: It's in Response Message.


And then the following exception came out:
......
org.apache.axis2.AxisFault: Must Understand check failed for header ......
    at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:102)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:166)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:363)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
......


At the server side, I could create a custom Handler in a module
and engage it to the Service to resolve this problem.
But now, it's Client. So how can I resolve this problem using Client API or other method?

Could you have any ideas?
Thank you

============================================================
Guo Tianchong

1rd Development Department
Network Software Research and Development Division
NEC Advanced Software Technology Co., Ltd.

20F, SHINING TOWER, No.35, XueYuan Road,
HaiDian District, Beijing 100191, P.R.China

E-MAIL:  guotc@nec-as.nec.com.cn
TEL:     86-10-82334433-624
FAX:   86-10-82334434
TELNET:  8-0086-22-624
HP:      www.nec-as.com.cn
============================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] How to resolve the "...Must Understand check.." exception for Response SOAP message

Posted by Guo Tianchong <gu...@nec-as.nec.com.cn>.
Yesterday, I resolved the problem by myself.

I added the following code snippet into my client before operationClient.execute(true);

...
AxisConfiguration ac = outMsgCtx.getConfigurationContext().getAxisConfiguration();
ArrayList al = new ArrayList();
al.add(new MustUnderstandHandler());
ac.setInPhasesUptoAndIncludingPostDispatch(al);
...

In the MustUnderstandHandler class, mustUnderstand headblock is set processed = true.
Then the mustUnderstand exception didn't come out!

Thanks.
Guo

----- Original Message ----- 
From: "Guo Tianchong" <gu...@nec-as.nec.com.cn>
To: <ax...@ws.apache.org>
Sent: Thursday, December 04, 2008 3:06 PM
Subject: [Axis2] How to resolve the "...Must Understand check.." exception for Response SOAP message


| Dear Axis's master:
| 
| I'm a programer using Axis2 1.4.1 to develope a Web Service application.
| Now, I have met a problem about the famous "Must Understand check".
| But my case is a litter special.
| 
| The detail is that :
| 
| I used org.apache.axis2.client.OperationClient API to construct a custom
| SOAP message and send it to my Web Service like this:
| 
| ......
| MessageContext outMsgCtx = new MessageContext();
| outMsgCtx.setEnvelope(buildOutEnvelope());
| 
| Options opts = outMsgCtx.getOptions();
| opts.setTo(TARGET_EPR);
| opts.setAction("urn:download");
| 
| operationClient.addMessageContext(outMsgCtx);
| operationClient.execute(true);
| ......
| 
| By the SOAP Monitor and server log, I could judged that the Web Service did work
| and returned desired SOAP message.
| One of my Response message header block included mustUnderstand
| attributes, such as:
| 
| ...
|  <soap:Header>
|    <xxx:ID soap:mustUnderstand="1">42</xxx:ID>
|  </soap:Header>
| ...
| 
| #####
|    Please NOTE: It's in Response Message.
| 
| 
| And then the following exception came out:
| ......
| org.apache.axis2.AxisFault: Must Understand check failed for header ......
|    at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:102)
|    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:166)
|    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:363)
|    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
|    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
|    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
| ......
| 
| 
| At the server side, I could create a custom Handler in a module
| and engage it to the Service to resolve this problem.
| But now, it's Client. So how can I resolve this problem using Client API or other method?
| 
| Could you have any ideas?
| Thank you
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
| For additional commands, e-mail: axis-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org