【问题标题】:In Java 8, MyServicePort.java class is missing when generating java classes by using wsimport在 Java 8 中,使用 wsimport 生成 java 类时缺少 MyServicePort.java 类
【发布时间】:2014-12-15 19:17:18
【问题描述】:
在Java8中,使用生成的web服务java类
wsimport -keep http://sasikumar:8080/SimpleWebServiceServer/AdditionService?wsdl
我不能从生成的文件列表中创建 MyServicePort.java(AdditionPort.java) 类
所以任何人都可以给我一些关于在没有 MyServicePort.java(AdditionPort.java) 类的情况下编写客户端存根的想法
【问题讨论】:
标签:
java
web-services
wsdl
java-8
wsimport
【解决方案1】:
这个答案有点晚了。我在使用 maven 插件 jaxws-maven-plugin 时遇到了同样的问题。我正要为某些 Microsoft 服务生成客户端代码,一切正常,但缺少端口和服务类。在启用调试时,我看到了根本原因,有消息:
[WARNING] Ignoring SOAP port "WSHttpBinding_IMyService": it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.
line 1 of https://my.address.to.wsdl
[WARNING] Service "MyService" does not contain any usable ports. try running wsimport with -extension switch.
line 1 of https://my.address.to.wsdl
添加“-extension”解决了问题。