繁体   English   中英

使用Apache CXF为SOAP客户端指定SSLContext

[英]Specify SSLContext for SOAP Client Using Apache CXF

因此,我们有一个正在运行的SOAP客户端,客户最近将服务器切换为使用带有自签名证书的SSL。 现在,我试图找出如何使我们的客户端使用正确的SSL上下文。 我在这里找到一个相关的问题; 但我看不到如何将其绑定到我的代码中(相关部分摘要如下-DCAMethods [Soap]是cxf生成的接口)。

File tmp = cacheWsdl(UUID.randomUUID().toString(), new URL(wsdlLocation), anzoSSLContext);
// It would be useful to specify the SSLContext here, but I am working around that.
DCAMethods methods = new DCAMethods(tmp.toURI().toURL()); 
DCAMethodsSoap soapInterface = methods.getDCAMethodsSoap();
// Need to specify the SSLContext for this call.
String rawXmlData = (String) soapInterface.getCopy(connectionId, username, password, documentVersionId, rendition); 

我假设您需要两种方式的SSL身份验证,而不是对SOAP消息进行签名

CXF自己支持使用客户端证书的SSL连接。 它使用Java SSLContext,但是所有配置都是通过CXF配置文件完成的

请参阅我在第4步中给出的答案https://stackoverflow.com/a/37610607/6371459 ,以查看如何使用spring文件或以编程方式配置CXF。 SSL支持的完整文档在这里

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM