在Java8中,使用生成的Web服务java类
wsimport -keep http://sasikumar:8080/SimpleWebServiceServer/AdditionService?wsdl
我无法从生成的文件列表中获取 MyServicePort.java(AdditionPort.java) 类
所以有人给我一些关于在没有 MyServicePort.java(AdditionPort.java) 类的情况下编写客户端 stub 的想法
最佳答案
这个答案有点晚了。我在使用 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”解决了问题。
关于java - 在 Java 8 中,使用 wsimport 生成 java 类时缺少 MyServicePort.java 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27491438/