• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis2 and Soap Handler

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
}
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic