关于disableCNCheck选项的wsdl2java CXF命令行错误
我正在使用 CXF wsdl2java 命令行工具在 https 连接下从 WSDL 生成 Java 类。 在生成过程中一切都很顺利,但是当我调用 WSDL 提供的服务之一时,我得到了这个异常:
java.io.IOException: The https URL hostname does not match the Common Name (CN) on the server certificate. To disable this check (NOT recommended for production) set the CXF client TLS configuration property "disableCNCheck" to true.
Is this disableCNCheck I can set during java Classs Generation?似乎不是,或者至少它不是 wsdl2java 的有效选项。
我是否必须在 wsdl 或我的(grails)应用程序中指定使用生成的 java 类的内容?
I'm using CXF wsdl2java command line tool to generate Java classes from a WSDL under https connection.
Everything goes fine during generation, but when i call one of the services offered by the WSDL I get this exception:
java.io.IOException: The https URL hostname does not match the Common Name (CN) on the server certificate. To disable this check (NOT recommended for production) set the CXF client TLS configuration property "disableCNCheck" to true.
Is this disableCNCheck something I can set during java classes generation? It seems not, or at least it's not a valid option for wsdl2java.
Is it something I have to specify in the wsdl or in my (grails) application, which uses the generated java classes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,这与生成时间无关,而是与运行时有关。
为了设置disableCNCheck标志,我这样做了:
其中port是用于与SSL保护的API服务通信的对象。
It turns out that is not something about generation time, but runtime stuff.
To set the disableCNCheck flag, I did it this way:
where port is the object used to talk with the SSL-protected API service.
我通过将以下 xml 配置添加到 grails-app/conf/spring/resources.xml [ Grails 2.2.3 , cxf-client 插件 1.6.1] 来实现disableCNCheck
I got the disableCNCheck achieved by adding the below xml config to grails-app/conf/spring/resources.xml [ Grails 2.2.3 , cxf-client plugin 1.6.1]