I was able to resolve the problem by using serviceClient directly
without generating it through stub._getServiceClient(). Hence, if you
want to access the soap response, make sure to use serviceClient as follows.
ServiceClient serviceclient = new ServiceClient();
OperationContext operationContext = serviceclient.getLastOperationContext();
MessageContext messageContext =
operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
System.out.println(messageContext.getEnvelope().toString());
regards
Charitha
Charitha Kankanamge wrote:
Folks,
I tried to access the response soap envelope using Axis2 client API as
follows.
OperationContext operationContext =
stub._getServiceClient().getLastOperationContext();
MessageContext messageContext =
operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
System.out.println(messageContext.getEnvelope().toString());
However, the following exception was thrown when running the client.
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'v'
(code 118) in epilog; expected '<'
at [row,col {unknown-source}]: [1,425]
at
com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1071)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:153)
I'm not sure if the above is the correct way of accessing soap
response at client side. Can someone please check the above and let me
know? I'm using Axis2-1.3 in winxp.
regards
Charitha
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Charitha Kankanamge
WSO2 inc.
Flower Road, Colombo 07
+94 714268070
A bug in the hand is better than one as yet undetected
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]