This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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();
}
}
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic