在Java 8中,使用wsimport生成java类时缺少MyServicePort.java类

时间:2014-12-15 19:17:18

标签: java web-services wsdl java-8 wsimport

在Java8中,使用

生成Web服务java类
wsimport -keep http://sasikumar:8080/SimpleWebServiceServer/AdditionService?wsdl

我不能从生成的文件列表中找到MyServicePort.java(AdditionPort.java)类

enter image description here

所以任何人都给我一些关于编写没有MyServicePort.java(AdditionPort.java)类的客户端存根的想法

1 个答案:

答案 0 :(得分:3)

这个答案有点晚了。我在使用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"解决了问题。