问题描述
我正在 Windows 7 上从命令提示符运行 JDK 1.8.0_51 wsimport.WSDL URL 通过 HTTPS 访问:
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
WSDL 包含对也可通过 HTTPS 访问的 XSD 的引用:
The WSDL contains a reference to an XSD also accessed via HTTPS:
...schemaLocation="https://...?xsd=1"
我收到此警告:
[警告] schema_reference:无法读取架构文档...?xsd=1",因为由于 accessExternalSchema 属性设置的限制,不允许https"访问.
该工具确实生成了客户端 Java 代码,但我不确定此代码是否正确.
The tool does generate the client Java code, but I am not sure if this code is correct.
我尝试通过使用 javax 创建 jaxp.properties 文件来遵循 WebService Client Generation Error with JDK8 中提供的解决方案.xml.accessExternalSchema=all 并将此文件放在 %JAVA_HOME%\jre\lib 中.没有效果.
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.
我也尝试将此文件放在其他子目录中,例如 %JAVA_HOME%\lib(在 http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA),和 %JAVA_HOME%\bin,都无济于事.
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.
那么,问题归结为:如何在wsimport的上下文中指示JAXP允许HTTPS协议?似乎没有任何 wsimport 命令行选项来传达这样的设置.
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?
推荐答案
尝试添加选项 -J-Djavax.xml.accessExternalSchema=all
.
这篇关于由于 XSD 上的 HTTPS,wsimport schema_reference 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!