【发布时间】:2023-03-26 21:36:01
【问题描述】:
我有一个使用相互 SSL 身份验证的 Web 服务。安装客户端证书后,我可以在浏览器中正常访问它。
我需要能够使用 wsimport 来访问它以生成 Java 代码来访问服务。
如何设置我的凭据以便可以使用 wsimport 访问 URL?
这是我正在尝试的示例,但由于无法进行身份验证而超时。
wsimport ./sample.wsdl -p com.company.ws.sample -Xnocompile -d ./src -extension -keep -XadditionalHeaders
感谢您的帮助
编辑:
这是wsimport 打印的内容。 WSDL 绝对是有效的,在给定的位置,只需弄清楚如何传递我的凭据以进行身份验证:
wsimport https://wsdl.location.com?WSDL -p com.company.ws.sample -Xnocompile
-d ./src -extension -keep -XadditionalHeaders
parsing WSDL...
[ERROR] Received fatal alert: handshake_failure
Failed to read the WSDL document: "https://wsdl.location.com?WSDL", because 1) could
not find the document; /2) the document could 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.
【问题讨论】:
-
分享您遇到的错误/异常堆栈跟踪有助于其他人理解问题。
-
我已更新帖子以显示更多详细信息。谢谢
标签: java web-services jax-ws wsimport