无效的算法参数异常:为安全的Soap Web服务生成源

时间:2018-06-06 08:06:01

标签: web-services ssl-certificate keystore keytool truststore

我尝试从 wsdl 获取具有 SSL 证书的源类。首先,我从Web服务获得证书。 然后我使用下面的命令将它添加到 keystore

keytool -import -alias trele -keystore ./cacerts -file ./trele.cer

然后我运行以下命令来生成源/客户端文件,

java -classpath C:/"Program Files"/Java/jdk1.8.0_25/lib/tools.jar -Djavax.net.debug=all -Djavax.net.ssl.trustStore="C:/Program Files/Java/jdk1.7/jre/lib/security/cacerts" -Djavax.net.ssl.trustStorePassword=changeit com.sun.tools.internal.ws.WsImport -keep -d C:\Users\Niro\Desktop\new_services -s C:\Users\Niro\Desktop\new_sources -p biz.company.domain https://absolute.domain/mws-ws/services/System_Integration?wsdl

然后我得到了以下异常,

main, handling exception: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
%% Invalidated:  [Session-1, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256]
main, SEND TLSv1.2 ALERT:  fatal, description = internal_error
main, WRITE: TLSv1.2 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 03 00 02 02 50                               ......P
main, called closeSocket()
[ERROR] java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Failed to read the WSDL document: https://absolute.domain/mws-ws/services/System_Integration?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] 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.

对此例外有任何想法。

0 个答案:

没有答案