我使用soap API創建Soap請求java .my代碼看起來像。如何在soap APi中設置Tlsv1.2 Java
/**
* Used to create dummy request for the SOAP operation
*
* @param operationName
* @param wsdlPath
* @return
* @throws Exception
*/
private Document generateRequestBody(String operationName, String wsdlPath) throws Exception {
WsdlOperation operation = null;
String request = null;
Document document = null;
if (null == this.wsdl) {
// Creating WsdlProject Object to load the wsdl using SOAPUI API
WsdlProject wsdlProject = new WsdlProject();
appLog.info("wsdlProject" + wsdlProject);
appLog.info("wsdlPath" + wsdlPath);
try {
//WsdlInterface[] wsdls = WsdlInterfaceFactory.importWsdl(wsdlProject, wsdlPath,true);
WsdlInterface[] wsdls = WsdlImporter.importWsdl(wsdlProject, wsdlPath);
wsdl = wsdls[0];
} catch (Exception e) {
appLog.debug("Error got", e);
}
}
if (null != wsdl) {
operation = wsdl.getOperationByName(operationName);
}
request = operation.createRequest(true);
// Converting the request content into XML document
document = dBuilder.parse(new InputSource(new StringReader(request)));
return document;
}
這裏我的wsdl Url Https沒有得到加載,因爲我的服務器是TLSv1.2強制執行。所以我得到以下例外
未能加載URL [https://82.150.238.5:5044/sst/SambaCustomerPreferenceService.http.ssl.v1-4-0-0?WSDL]>
<> <> <> < 1500268274375> < 05:11:14375 ERROR [了SoapUI]發生錯誤 [ com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException], 查看錯誤日誌以獲取詳細信息> #### <> <> <> < 1500268274375>
請告訴如何設置TLSV1.2
肥皂UI代碼。
您應該在這裏分享錯誤日誌的最重要部分。您提供的鏈接無法訪問我...我建議您描述更多詳細信息。 – Sergii
無法加載網址[https://82.150.238.5:5044/sst/SambaCustomerPreferenceService.http.ssl.v1-4-0-0?WSDL]> <><><><1500268274375><05:11 :14,375錯誤[SoapUI]發生錯誤[com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException],請參閱錯誤日誌以獲取詳細信息> #### <><><><1500268274375> .. –
I我只是在試圖從安全通道(Https)使用soap api java加載wsdl時纔得到這個問題。 Http工作正常.. –