java Axis2 Webservice 故障 - 找不到端点引用的服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16192151/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 22:10:45  来源:igfitidea点击:

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

javaweb-servicesjakarta-eesoapaxis2

提问by Saju

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

Hi 创建了一个测试应用程序来学习 Axis2。我用我的War和 afetr 部署打包了轴,WSDL 也可以通过 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.

但是当我尝试使用带有上述 URL 的客户端存根调用服务时,它不起作用。

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.SajuServicesHttpEndpointit is working. I am using JDK1.6 and JBoss. I have included the axis2.xml in conf of metainf and also the services.xmlas below

但是如果我用http://localhost:9091/SajuAxis2/SajuService/SajuServices.SajuServicesHttpEndpoint它替换端点 URL就可以了。我正在使用 JDK1.6 和 JBoss。我已经包括在metainf的conf下axis2.xml和也的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>

采纳答案by Saju

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

我解决了。这是axis2.xml 中的错误配置。我给出了错误的上下文路径。

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

udated to

日期为

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

回答by Ratha

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.

您必须提供服务端点 url..Not wsdl url。您正在向要处理的服务发送请求......而不是向 wsdl。