您好创建了一个测试应用程序来学习 Axis2。我用我的 war 打包了轴,并在部署之后,还可以通过 URL 访问 WSDL - http://localhost:8081/SajuAxis2/test/service/SajuServices.wsdl
但是当我尝试使用具有上述 URL 的客户端 stub 调用该服务时,它不起作用。
SajuServicesStub stub = new SajuServicesStub("http://localhost:8081/SajuAxis2/test/service/SajuServices?wsdl");
但是,如果我用 http://localhost:9091/SajuAxis2/SajuService/SajuServices.SajuServicesHttpEndpoint
替换端点 URL,它就可以工作。我使用的是JDK1.6和JBoss。我已将 axis2.xml 包含在 metainf 的 conf 中,还包含如下的 services.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: 1.5.6 Built on : Aug 30, 2011 (10:00:16 CEST) -->
<serviceGroup>
<service name="SajuServices">
<messageReceivers>
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="service.SajuServicesMessageReceiverInOut"/>
</messageReceivers>
<parameter name="ServiceClass">service.SajuServicesSkeleton</parameter>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<operation name="process" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://service">
<actionMapping>urn:process</actionMapping>
<outputActionMapping>urn:processResponse</outputActionMapping>
<faultActionMapping faultName="RemoteException">urn:processRemoteException</faultActionMapping>
</operation>
</service>
</serviceGroup>
最佳答案
我解决了。这是 axis2.xml 中的错误配置。我给出了错误的上下文路径。
<parameter name="servicePath">SimpleService</parameter>
更新至
<parameter name="servicePath">services</parameter>
关于java - Axis2 Web 服务故障 - 找不到端点引用的服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16192151/