Returning raw soap response in java using JAX-WS?

You can use a packet sniffing program or a proxy based program.

You can use a packet sniffing program or a proxy based program. Fiddler is a great proxy based program or there is the JAX-WS WSMonitor tool. For packet sniffing: Wireshark To get access to the SOAPMessage, you effectively need to create a class that implements the javax.xml.ws.handler.soap.

SOAPHandler interface: public class MySoapHandler implements SOAPHandler { @Override public Set getHeaders () { ... } @Override public boolean handleMessage (final SOAPMessageContext context) { ... } @Override public boolean handleFault (final SOAPMessageContext context) { ... } @Override public void close (final MessageContext context) { ... } } and add this to your service binding's handler chain: final BindingProvider bindingProvider = (BindingProvider) proxy; final Binding binding = bindingProvider. GetBinding (); final List handlerChain = binding. GetHandlerChain (); handlerChain.

Add (new MySoapHandler ()); binding. SetHandlerChain (handlerChain); The magic happens in handleMessage/handleFault methods of your custom handler. Once you have a SOAPMessageContext you call the getMessage method and it will return you an instance of javax.xml.soap.SOAPMessage.

SOAPMessage is an object representation of the raw soap packet. From here you should be able to reconstruct the XML structure for your purposes. SOAPMessage API docs.

Thanks, but I would like to display the raw data in my application. – zSysop Jun 3 at 23:39 Are you using any 3rd party SOAP libraries at runtime? – Jordan S.

Jones Jun 3 at 23:42 No I'm not using any 3rd party libs. Just using the classes that were generated by wsimport. – zSysop Jun 3 at 23:47 Sun/Oracle's runtime?

– Jordan S. Jones Jun 3 at 23:57 Nope i'm not using those – zSysop Jun 37 at 0:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions