我有一个使用相互 SSL 身份验证的 Web 服务。安装客户端证书后,我可以在浏览器中正常访问它。
我需要能够使用wsimport
生成 Java 代码来访问该服务来访问它。
如何设置我的凭据以便我可以使用 访问 URL wsimport
?
这是我正在尝试的示例,但由于无法进行身份验证而超时。
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.