我想使用 wsdl 导入 Web 服务。服务器使用 TLSv1.2。
使用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
我是一名优秀的程序员,十分优秀!