如何在soap APi Java中设置Tlsv1.2

时间:2017-07-25 05:09:57

标签: java

我正在创建使用soap Api java .my代码的Soap Request。

wordArray.push_back(word);

这里我的wldl与Url Https没有加载,因为我的服务器是强制执行TLSv1.2。所以我得到以下异常

  

无法加载网址[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>   

         

请告诉我如何在Soap Ui代码中设置/** * 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; }

1 个答案:

答案 0 :(得分:0)

根据我的知识,错误可以通过以下解决方案解决。

  1. 在浏览器中检查WSDL的URL。它打开了吗?如果没有,则不启动服务器并且无法访问WSDL协定。

  2. 确保您没有使用代理,并且您没有在SOAP UI首选项中设置某个代理选项

  3. WSDL的有效性问题,但如果不进行检查则无法判断。