2017-07-25 71 views
0

我使用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代碼。

+0

您應該在這裏分享錯誤日誌的最重要部分。您提供的鏈接無法訪問我...我建議您描述更多詳細信息。 – Sergii

+0

無法加載網址[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> .. –

+0

I我只是在試圖從安全通道(Https)使用soap api java加載wsdl時纔得到這個問題。 Http工作正常.. –

回答

0

根據我的知識錯誤可以通過下面的一些解決方案來解決。

  1. 在瀏覽器中檢查WSDL的URL。它打開了嗎?如果沒有,您的服務器沒有啓動,WSDL協議無法訪問。

  2. 確保您不使用代理,你不必在SOAP UI的喜好與您的WSDL的有效性

  3. 問題設置一些代理選項,但不可能說沒有檢查它。

+0

Wsdl很好,它使用Http。只有問題與https。 Wsdl正在瀏覽器中打開。我使用Soap Ui java API來創建請求,以便檢查代理的soap ui首選項。 –