• Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis2 and Soap Handler

 
Ayyappan Selvaraj
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im using Axis2 to generate Client Jar and I want to extract the Soap request and Soap Response XMLs for the requests I raise using the stub object.
Its an urgent requirment. Can any one help pls..
Thanks in advance.
 
Nikhil Reddy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
private static void printSOAPMessages(org.apache.axis.client.Stub stub){
Message message;
try {
org.apache.axis.client.Service service = (org.apache.axis.client.Service) stub._getService();

org.apache.axis.client.Call call = service.getCall();

MessageContext msgContext = call.getMessageContext();

// Print the Request Object

message = msgContext.getRequestMessage();

Message requestMessage = new Message(message.getSOAPEnvelope());
System.out.println("REQUEST:");
System.out.println(requestMessage.getSOAPPartAsString().toString());
message = msgContext.getResponseMessage();
System.out.println("RESPONSE:");
System.out.println(message.getSOAPPartAsString().toString());
System.out.println("\n"+message.getSOAPPartAsString().toString());

} catch (Exception e) {
e.printStackTrace();
}
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!