0
我沒有收到在SOAP消息的SOAPHEADER標籤調用CXF服務。我當前的代碼如下:的SOAPHeaders沒有在對的SOAPMessage CXF服務通過在Apache的駱駝
我已經定義了CXF:爲服務cxfEndpoint:
<cxf:cxfEndpoint id="testService" address="${testserviceurl}"
serviceClass="com.test.service.class" wsdlURL="test.wsdl"
endpointName="ns:test" serviceName="ns:TestService"
xmlns:ns="target.name.space.of.the.service">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
</cxf:properties>
</cxf:cxfEndpoint>
,然後調用我的CXF端點之前,我已經設置了SOAPHEADER爲:
CxfPayload<SoapHeader> payload = exchange.getIn().getBody(
CxfPayload.class);
List<SoapHeader> headers = payload.getHeaders();
SoapHeader header = new SoapHeader(new QName("HeaderName"), "Test");
headers.add(header);
我也試過這種方法:
List<SoapHeader> soapHeaders = CastUtils.cast((List<?>) exchange
.getIn().getHeader(Header.HEADER_LIST));
if (soapHeaders == null) {
// we just create a new soap headers in case the header is null
soapHeaders = new ArrayList<SoapHeader>();
}
SoapHeader header = new SoapHeader(new QName("HeaderName"),
"Test");
header.setDirection(Direction.DIRECTION_OUT);
soapHeaders.add(header);
任何人都可以請幫助這是什麼問題?
嗨Vijendra,謝謝你的迴應。我可以設置請求標頭,但問題在於有效負載消息中標籤''下的SOAP標頭。 –
Prasann