小编use*_*965的帖子

CXF传出Interceptor得到的SOAP响应体总是为null?

我写了一个拦截器进行测试.但是我在Interceptor中得到的Soap消息体总是为空.

我的Cxf是Apache-CXF-2.4.0

bean.xml是这样的:

<cxf:bus>
    <cxf:outInterceptors>
        <ref bean="myOutSoapInterceptor"/>
  </cxf:outInterceptors>
</cxf:bus>
Run Code Online (Sandbox Code Playgroud)

拦截器文件:

public class MySoapInterceptorImpl extends AbstractSoapInterceptor implements IMySoapInterceptor {

public MySoapInterceptorImpl()
{
    super(Phase.WRITE );
    addAfter(SoapOutInterceptor.class.getName());
}


public void handleMessage(SoapMessage msg) throws Fault {
    // TODO Auto-generated method stub
    String soapContent ;
    SOAPMessage sm = msg.getContent(SOAPMessage.class);

    /*sm is always null!*/
    }
 }
Run Code Online (Sandbox Code Playgroud)

soap cxf response interceptor

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

cxf ×1

interceptor ×1

response ×1

soap ×1