Axis2 Webservice Fault - The service cannot be found for the endpoint reference

元气小坏坏 提交于 2019-12-11 04:41:46

问题


Hi created a test application to learn Axis2. I packed the axis with my war and afetr deployment the WSDL is also acessible via URL - http://localhost:8081/SajuAxis2/test/service/SajuServices.wsdl

But when I try to invoke the service using client stub with the above URL, it is not working.

SajuServicesStub stub = new SajuServicesStub("http://localhost:8081/SajuAxis2/test/service/SajuServices?wsdl");

But if I replace the endpoint URL with http://localhost:9091/SajuAxis2/SajuService/SajuServices.SajuServicesHttpEndpoint it is working. I am using JDK1.6 and JBoss. I have included the axis2.xml in conf of metainf and also the services.xml as below

 <?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>

回答1:


I solved it. It was a misconfiguration in axis2.xml. I given wrong context path.

<parameter name="servicePath">SimpleService</parameter>

udated to

<parameter name="servicePath">services</parameter>



回答2:


You have to provide service endpoint url..Not the wsdl url. You are sending requests to the service to be processed..not to the wsdl.



来源:https://stackoverflow.com/questions/16192151/axis2-webservice-fault-the-service-cannot-be-found-for-the-endpoint-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!