通过将https.protocol设置为TLSv1.2 wsimport

问题描述:

我想使用wsdl导入Web服务。服务器正在使用TLSv1.2。通过将https.protocol设置为TLSv1.2 wsimport

使用Java代码我通过设置System.setProperty("https.protocols", "TLSv1.2");

我该怎么做,而使用的wsimport相同的连接到服务器?我正在使用Java 1.7.0_65。

当我试图wsimport <wsdl-url>我得到

parsing WSDL... 


[ERROR] Received fatal alert: protocol_version 

Failed to read the WSDL document: https://<server-name>/Test/Test/Transform?wsdl, because 1) could not find the document; /2) the document cou 
ld not be read; 3) the root element of the document is not <wsdl:definitions>. 


[ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s): 

At least one WSDL with at least one service definition needs to be provided. 


    Failed to parse the WSDL. 

"C:\Program Files (x86)\Java\jdk1.7.0_80\bin\java" -classpath "C:\Program Files (x86)\Java\jdk1.7.0_80\lib\tools.jar" -Dhttps.protocols=TLSv1.2 com.sun.tools.internal.ws.WsImport -keep -verbose https://<server-name>/Test/Test/Transform?wsdl