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" <[EMAIL PROTECTED]> To: <[email protected]> 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: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
