Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 812
user1408140 Avatar asked Aug 13 '15 19:08

user1408140


1 Answers

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

like image 82
haba713 Avatar answered Oct 17 '22 10:10

haba713