In my project, I need to log the soap Request and Response in database in Apache CXF. In each web service request, we generate a unique ID and this ID will be the primary key in database for logging the soap request & response.
I have tried the LoggingInInterceptor. We prefer to put the interceptor configuration in XML or in static block so that it will be instantiated only once. But in this scenarios we are not able to pass the unique ID to the interceptor .
So we tried to create a custom interceptor and instantiate this interceptor in each request by passing the unique ID in the constructor.Log the details in database using this ID in handleMessage() method.