wsimport schema_reference warning due to HTTPS on XSD
Asked Answered
S

2

6

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?

Soracco answered 13/8, 2015 at 19:18 Comment(1)
Hi, did You solved this problem somehow?Enumerate
M
9

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

Maclay answered 4/4, 2018 at 20:38 Comment(1)
This worked. The trick is to avoid any spaces between -J and -D.Soracco
S
-2

Since I asked this question, I was not able to get rid of the wsimport warning; I simply ignored it. While I have not observed any adverse effects, I am still not 100% convinced that the generated code is correct and optimal, since the XSD is not being read.

Soracco answered 7/3, 2018 at 14:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.