我的请求如下
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://example.org/HelloService">
<soapenv:Header>
<sampler>Test</sampler>
</soapenv:Header>
<soapenv:Body>
<hel:LastName>
<lastName>Test</lastName>
</hel:LastName>
</soapenv:Body>
</soapenv:Envelope>
我的暴露 CXF:proxy-service 的流程如下
<flow name="WS_In">
<http:inbound-endpoint address="http://localhost:8080/HelloService"
exchange-pattern="request-response">
<cxf:proxy-service wsdlLocation="classpath:helloservice.wsdl"
namespace="http://example.org/HelloService" service="ProxyService" >
<cxf:inInterceptors>
<spring:bean id="inLogger"
class="org.apache.cxf.interceptor.LoggingInInterceptor" />
<spring:bean id="msgInt" class="com.example.components.MessageInterceptor"/>
</cxf:inInterceptors>
</cxf:proxy-service>
</http:inbound-endpoint>
<component>
<spring-object bean="proxyService"></spring-object>
</component>
<echo-component></echo-component>
</flow>
但我无法获取肥皂标题中的元素。我尝试使用如下方法使用拦截器
@Override
public void handleMessage(SoapMessage message) throws Fault {
System.out.println("The headers is " + message.getHeaders() );
}
但这是打印一个emply Collection。
请建议我如何得到这个。