gpt4 book ai didi

java - 通过将 https.protocol 设置为 TLSv1.2 进行 wsimport

转载 作者:太空宇宙 更新时间:2023-11-04 12:50:06 24 4
gpt4 key购买 nike

我想使用 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

关于java - 通过将 https.protocol 设置为 TLSv1.2 进行 wsimport,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35916192/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com