如何解决尝试为 Sabre Retrieve Itinerary API 生成工件时 wsimport schema_reference 警告
我正在尝试为 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)
有没有其他人遇到过这个问题或知道如何解决它?
解决方法
以下命令对我有用...
wsimport -J-Djavax.xml.accessExternalDTD=all -J-Djavax.xml.accessExternalSchema=all -keep -verbose https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl -Xnocompile
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。