1

With the following link Logging request/response with Apache CXF as XML, I can log my Webservice SOAP Request to server console log file, my implementation likes this:

ServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.getInInterceptors().add(new LoggingInInterceptor(newPrintWriter(System.err)));
svrFactory.getOutInterceptors().add(new LoggingOutInterceptor(new PrintWriter(System.err)));

But now I want to check a param "MESSAGE_ID" in the SOAP request to save the SOAP request to the separated file MESSAGE_ID.xml.

Is there any way to do in the Interceptor implementation ?

Community
  • 1
  • 1
Mao
  • 77
  • 2
  • 7
  • 2
    Create your own interceptor class that extends ``AbstractPhaseInterceptor``. In the method ``handleMessage`` you have access to the soap message, where you can access the payload. – f1sh Oct 31 '16 at 12:35
  • It works. thank @f1sh – Mao Nov 02 '16 at 11:00

0 Answers0