java wsimport https_java – 当服务器需要客户端证书时如何使用wsimport?

我有一个使用相互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 .

[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.


版权声明:本文为weixin_39819974原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。