[英]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.