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);