java - wsdl2java 在没有服务的情况下使用 Apache Axis2 for WSDL

标签 java apache wsdl axis2

我正在尝试使用 Apache Axis2 从 WSDL 生成 Java 类。但每次失败时都会出现以下日志:

~/Downloads/axis2-1.6.1/bin $ ./wsdl2java.sh -ssi -uri ../HelloWorld.wsdl

 Using AXIS2_HOME: /home/prpandey/Downloads/axis2-1.6.1
 Using JAVA_HOME:  /softwares/jdk1.6.0_31
Retrieving document at '../HelloWorld.wsdl'.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:175)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.AxisFault: No services found in the WSDL at file:/home/prpandey/Downloads/axis2-1.6.1/bin/../HelloWorld.wsdl with targetnamespace http://www.example.org/HelloWorld/
    at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:115)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:169)
    ... 2 more

这是 WSDL 文件:http://pastie.org/3719679

最佳答案

您的 WSDL 没有定义 wsdl:service 标签。这可能是错误吗?

请添加一个绑定(bind)和一个服务,然后重试。

关于java - wsdl2java 在没有服务的情况下使用 Apache Axis2 for WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9990621/

相关文章:

java - 在 Android 中通过 HTTP/2 发布流媒体音频

java - Tomcat 管理器 : Cannot Upload Large WAR file

java - 使用 C# 调用 Yellowfin 商业智能服务

web-services - 是否可以在 Glassfish 3.1 WebServices 中发布原始 WSDL?

java - Android - 在 Activity 之间传递一组类

java - 如何在不同类的Swing组件之间进行交互?

java - 是什么导致我的java代码的这部分出现空指针异常?

Spring MVC 4 Security 在 SSL 模式下不工作

apache - 如何在 Apache Ivy 中添加自定义 jar

c# - .NET Web 服务无法生成临时类