Question

I am using CXF JAX-WS in mule flow to access a service.

I am able to access it successfully.

Is there any way I can see the message that is being sent to the service just before it is sent?

Was it helpful?

Solution

Try the Logging Iterceptors.

<cxf:jaxws-client clientClass="com.example.MyexampleService"
    wsdlLocation="MyService.wsdl"               
    operation="sayHello" port="MyServicePort"        
    doc:name="SOAP">
    <cxf:outInterceptors>
 <spring:bean id="outLogger"
 class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
    </cxf:outInterceptors>
</cxf:jaxws-client>             

OTHER TIPS

You can opt to print the payload just before call to JAX WS client like this:

<logger message="------>Payload #[payload] before calling the web service client." level="INFO" />

OR use a Out Interceptor to print the incoming request and In Interceptor to print service response

<cxf:jaxws-client clientClass="..."
        wsdlLocation="..."              
        operation="..."  >                
        <cxf:inInterceptors>
            <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />                  
        </cxf:inInterceptors>
        <cxf:outInterceptors>
            <spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
        </cxf:outInterceptors>              
</cxf:jaxws-client>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top