File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes log outgoing JAX-RPC message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "log outgoing JAX-RPC message" Watch "log outgoing JAX-RPC message" New topic

log outgoing JAX-RPC message

szabolcs kléninger

Joined: Dec 04, 2009
Posts: 2

I'm developing a Webapp in Netbeans which calls an external WebService.
I have imported the wsdl file, generated JAX-RPC stub( Right click on Project / WebService Client...), and set the message payload for the WS call.
Is it possible to log(save) the outgoing Request message?
Here is the generated stub and the message.
I want to save the outgoing SOAP message in a Database, and of course the Response message too.

Thanks for helping!
Karthik Shiraly

Joined: Apr 04, 2009
Posts: 873


You can add Handlers on both sides through your Service's HandlerChain. Your handler receives SOAPMessageContext objects, and you can then get SOAPMessage out of that and write it out to an OutputStream (or DB).
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
As Karthik says, handlers is a good way. There is an article showing how to implement JAX-RPC handlers at:
Best wishes!
I agree. Here's the link:
subject: log outgoing JAX-RPC message
jQuery in Action, 3rd edition