javaweb-serviceshttpswsimportjaxp

wsimport schema_reference warning due to HTTPS on XSD


I am running the JDK 1.8.0_51 wsimport from a Command Prompt on Windows 7. The WSDL URL is accessed via HTTPS:

wsimport -keep -Xnocompile https://...?wsdl

The WSDL contains a reference to an XSD also accessed via HTTPS:

...schemaLocation="https://...?xsd=1"

I get this warning:

[WARNING] schema_reference: Failed to read schema document '...?xsd=1', because 'https' access is not allowed due to restriction set by the accessExternalSchema property.

The tool does generate the client Java code, but I am not sure if this code is correct.

I tried to follow the solution offered in WebService Client Generation Error with JDK8 by creating a jaxp.properties file with javax.xml.accessExternalSchema=all and placing this file in %JAVA_HOME%\jre\lib. No effect.

I also tried to place this file in other sub-directories, such %JAVA_HOME%\lib (which is mentioned in http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA), and %JAVA_HOME%\bin, all to no avail.

So, the problem boils down to: How to instruct JAXP in the context of wsimport to allow the HTTPS protocol? There does not appear to be any wsimport command-line option to convey such a setting.

Any other suggestions on how to accomplish this?


Solution

  • Try adding the option -J-Djavax.xml.accessExternalSchema=all.