0
因此,我们有一个工作正常的SOAP客户端,最近客户将服务器切换到使用带有自签名证书的SSL。现在我试图弄清楚如何让我们的客户端使用正确的SSL上下文。我发现一个相关的问题here;但我不明白如何将其与我的代码绑定(相关部分概述如下 - DCAMethods [Soap]是一个cxf生成的接口)。使用Apache CXF为SOAP客户端指定SSLContext
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);