【发布时间】:2021-05-20 20:39:01
【问题描述】:
我正在尝试为Sabre Retrieve Itinerary 生成工件。
这是我正在使用的脚本:
wsimport -keep \
-verbose \
https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl \
-B-XautoNameResolution \
-Xnocompile
但是我收到以下警告,即使生成了 Java 代码,我也不确定它是否正确。
[WARNING] schema_reference: Failed to read schema document 'msg-header-2_0.xsd', because 'https' access is not allowed due to restriction set by the accessExternalSchema property.
line 4 of https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl#types?schema1
这个警告有点奇怪,因为 WSDL 包含这一行:
<xsd:import namespace="http://www.ebxml.org/namespaces/messageHeader" schemaLocation="msg-header-2_0.xsd"/>
所以 msg-header-2_0.xsd 是通过 http 引用的,而不是 https。
到目前为止我所尝试的:
- 我将 jaxp.properties 文件添加到我的 JAVAHOME/lib 和 JAVAHOME/jre/lib 中,内容如下:
javax.xml.accessExternalSchema = all
- 我按照in this post的建议添加了一个附加选项:
-J-Djavax.xml.accessExternalSchema=all
但这些都没有帮助。我的设置如下:
java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (Zulu 8.54.0.21-CA-macosx) (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (Zulu 8.54.0.21-CA-macosx) (build 25.292-b10, mixed mode)
有其他人遇到过这个问题或知道如何解决吗?
【问题讨论】: