soapsabrewsimport

wsimport schema_reference warning when trying to generate artifacts for Sabre Retrieve Itinerary API


I am trying to generate artifacts for Sabre Retrieve Itinerary.

This is the script I am using:

wsimport -keep \
         -verbose \
         https://developer.sabre.com/sites/default/files/resources/8258/GetReservation_1.19.0.wsdl \
         -B-XautoNameResolution \
         -Xnocompile

However I am getting the following warning and even though Java code gets generated I am not sure if it's correct.

[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

This warning is a bit weird as the WSDL contains this line:

<xsd:import namespace="http://www.ebxml.org/namespaces/messageHeader" schemaLocation="msg-header-2_0.xsd"/>

So msg-header-2_0.xsd is referenced via http, not https.

What I have tried so far:

  1. I added jaxp.properties file to my JAVAHOME/lib and JAVAHOME/jre/lib with the following content:

javax.xml.accessExternalSchema = all

  1. I added an additional option as suggested in this post:

-J-Djavax.xml.accessExternalSchema=all

But neither of those helped. My setup is as follows:

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)

Has anybody else encountered this problem or knows how to fix it?


Solution

  • The following command works for me...

    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