2013-04-23 107 views
0

如何打印发送到Web服务(CXF2)的SOAP请求消息?我正在使用Eclipse。如何打印SOAP请求消息?

我想看看它包含哪些字段并在此结构之后构建SOAP消息。

+0

是在SOAPMessage对象的消息? – Kishore 2013-04-23 11:37:27

回答

0

你刚才NEDD添加LoggingInterceptor:看cxf documentation

Object implementor = new GreeterImpl(); 
EndpointImpl ep = (EndpointImpl) Endpoint.publish("http://localhost/service", implementor); 

ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor()); 
ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor()) 

或者,如果您使用Springframework

<bean id="quickFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> 
    <property name="serviceClass" value="com.misc.PortType"/> 
    <property name="address" value="${service.url}"/> 
    <property name="inInterceptors"> 
     <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> 
    </property> 
    <property name="outInterceptors"> 
     <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> 
    </property> 
</bean>