我试图使用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标记。这可能是错误吗?
请添加一个binding和一个service并重试。

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

10-16 20:15