我必须使用 WCF Web 服务并获得 WSDL(外部,因此无法控制 WSDL)。在 WSDL 定义中,我没有找到具有服务、端口和地址元素的服务元素。WSDL 中不存在这种正常情况吗?这对于 WCF WSDL 来说很常见吗?我正在尝试使用轴为此生成存根并且遇到问题。
<wsdl:definitions>
....
...
..
**<wsdl:service>
<wsdl:port>
<wsdl1:address/>
</wsdl:port>
</wsdl:service>**
</wsdl:definitions>
星号之间的部分是 WSDL 中缺少的部分。
有人遇到过这样的问题吗?请告诉我。
生成存根时,出现此错误:线程“主”org.apache.axis2.wsdl.codegen.CodeGenerationException 中的异常:在 org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:175 解析 WSDL 时出错) ) at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) 原因:org.apache.axis2.AxisFault:在 org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:115) 的 org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:115)的文件:/c:/work/xxx.wsdl 的 WSDL 中没有找到服务,目标命名空间为http://tempuri.org/ 。 apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:169) ... 还有 2 个
我查看了代码 WSDL11ToAllAxisServicesBuilder.java,如果轴没有找到服务元素,就会出现这个错误。
有人对此有解决方案吗?