我正在使用要部署在 Karaf 中的骆驼 cxf 实现 Web 服务。我正在使用 karaf 附带的 pax web。我在 pom 中使用 cxf codegen 插件对 java 执行 wsdl。
我在 RouteBuilder Java DSL 中定义 cxf uri 和路由。blueprint.xml 只有一些 bean 和 RouteBuilder 的引用。
final String cxfUri =
String.format("cxf:%s?serviceClass=%s&wsdlURL=wsdl/Event.wsdl",
"/Event.jws", com.example.EventPortType.class.getCanonicalName());
我已经使用 pax-web(jetty.xml) 设置了 ssl。如果我发送带有用户名和密码的 WSSE 安全标头,它会生成 MustUnderstand soap 错误。
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" S:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Id-LdZa8aaGdy7mWQWXLp_zpbfg">
<wsse:Username>xxx</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxx</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
无法更改输入请求。我得到了这个例外。
<soap:Fault>
<faultcode>soap:MustUnderstand</faultcode>
<faultstring>MustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood.</faultstring>
</soap:Fault>
如何保护 cxf 端点以验证请求?
谢谢你。