I have created web-service client to the existing service in netbeans, and ide makes all in oop style correctly, but I need to log xml request and response to and from service, how to log these information?
Asked
Active
Viewed 3,508 times
1
-
Which stack of web services you are using? Is it JAX-WS, CXF....? How are exposing your web service endpoint? – Paulius Matulionis Oct 15 '12 at 10:28
-
I use jax-ws, web-service is deployed on glassfish – test1604 Oct 15 '12 at 10:37
-
Netbeans generate all code, and I do not know how to get xml data – test1604 Oct 16 '12 at 10:42
1 Answers
2
For the purpose of logging the request and response of your web service, you need to create your custom soap handler for JAX-WS
which implements SOAPHandler<SOAPMessageContext>
interface.
The method to do anything you like with a message is handleMessage(SAOPMessageContext messageContext)
. From the message context you will be able to get the SOAP message and log it.
See my post here how to implement SOAP handler interface and override handleMessage
method for the specific requirements.
This post leads to what you are trying to achieve. Take a look at this article. It might be helpful as well. If you are not able to set up your handler, come back with more specific problem.

Community
- 1
- 1

Paulius Matulionis
- 23,085
- 22
- 103
- 143