我创建了一个Web服务客户端来处理带有apache骆驼的cxf soap web服务。使用Apache Camel拦截cxf Web服务标头(Java DSL)
String serviceUri = "cxf:http://localhost:10000/myservice?serviceClass=" +
MyRequest.class.getCanonicalName();
from(uri).to("mock:xyz");
Web服务接收SOAP调用,但因为请求需要WSS的操纵抛出异常。
org.apache.cxf.binding.soap.SoapFault: MustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood.
的原因是,该服务需要WS安全性,这可以通过在请求lloking看到。
<SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" SOAP-ENV:mustUnderstand="1">
我发现我需要实现一个拦截器来处理标题属性。
我的问题:
我如何添加一个拦截器来处理标头骆驼Java的DSL属性?
这是否足以摆脱SOAP错误?
不幸 “&cxfEndpointConfigurer =” + MyConfigurer.class.getCanonicalName();没有工作,我得到错误信息“无法找到一个合适的setter属性:cxfEndpointConfigurer,因为没有一个setter方法具有相同的类型:java.lang.String也没有可能的类型转换:” – ABX
pls。阅读:http://camel.465427.n5.nabble.com/cxfEndpointConfigurer-in-an-URI-td5773083.html – Vadim