Here is some code that will give you the XML response payload. You can either get it directly from the AXIS Stub class, or from the handler that wrote it to MessageContext. Here's the one that reads it directly:
private String getSOAPResponseXML(Object clientstub) {
String returnValue = null;
org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub)clientstub;
Call call = stub._getCall();
if (call != null) {
MessageContext ctx = call.getMessageContext();
try {
Message msg = call.getResponseMessage();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
msg.writeTo(baos);
returnValue = baos.toString();
} catch (java.io.IOException ex) {
log.debug("Error in getSOAPResponseXML", ex);
} catch (javax.xml.soap.SOAPException ex) {
log.debug("Error in getSOAPResponseXML", ex);
}
}
return returnValue;
}
If you need a handler, just let me know.
source
share