gpt4 book ai didi

java - 当我尝试从 wsdl 生成客户端时出错

转载 作者:行者123 更新时间:2023-11-30 11:02:05 26 4
gpt4 key购买 nike

我想从 wsdl 生成一个 java 客户端。

所以我创建了一个新项目,将 wsdl 导入到项目中,然后右键单击 -> Web 服务 -> 生成客户端。

所以这是我使用的选项:

enter image description here

然后点击鱼,我有这个错误:

IWAB0399E Error in generating Java from WSDL:  WSDLException (at /definitions/types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/PianoAssistenzialeResidenzialeService?xsd=1', relative to 'file:/D:/Dropbox/workspace/Edotto/src/PianoAssistenzialeResidenzialeService.wsdl'.: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URLConnection.getContent(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContent(Unknown Source)
at java.net.URL.getContent(Unknown Source)
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Unknown Source)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Sour

最佳答案

您的 WSDL 导入一个带有 URL 的模式,该 URL 具有 https 地址方案。此错误表明您的 Java 安装不“信任”托管正在导入的此模式的服务器提供的证书。

你有几个选择:

  1. 将服务器的 CA 证书或服务器的实际证书导入您的信任库
  2. 将架构下载到本地位置并更改 WSDL 中的导入 url

我会推荐第二个选项,因为只要将 WSDL 和上述模式打包在一起,它的可移植性会稍微好一些。

关于java - 当我尝试从 wsdl 生成客户端时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30916265/

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