Looking at the SOAP message before it is sent to the consuming service

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?

Answers


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>             

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>

Need Your Help

Reordering Behaviors in CakePHP

cakephp cakephp-2.1

I'm writing a plugin which includes a behavior that has a dependency on the ContainableBehavior. In my behavior, I'd like to tweak any query conditions in its beforeFind() callback, but I'm finding...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.