クライアント側
<cxf:jaxws-client
serviceClass="org.example.MyService"
port="MyServicePort"
operation="MyOperation">
<cxf:inInterceptors>
<spring:bean class="org.example.MyInInterceptor"/>
</cxf:inInterceptors>
</cxf:jaxws-client>
以下のインターセプターで SOAP 応答から SOAPBody を取得する方法は?
public class MyInInterceptor extends AbstractSoapInterceptor {
@Resource
private WebServiceContext context;
public MyInInterceptor() {
super(Phase.RECEIVE);
}
@Override
public void handleMessage(SoapMessage cxfSoapMessage) throws Fault {
SOAPMessage soapMessage = cxfSoapMessage.getContent(SOAPMessage.class);
System.out.println("soapMessage ===> " + soapMessage);
}
}