Web Service通过service.xml发布时抛出异常

来源:互联网 发布:中国国际储备数据 编辑:程序博客网 时间:2024/05/21 17:21
Exception in thread "main" org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is http://localhost:8080/axis2/services/XMLService and the WSA Action = urn:anonOutInOp

查看Web Service的发布情况时是正常的,即localhost:8080/axis2/services/...?wsdl文件是能显示的,但没有方法,显示如下:

XMLServiceService EPR : http://localhost:8080/axis2/services/XMLServiceService Description : XMLServiceService Status : ActiveThere are no Operations specified

如果打包的aar文件没错的话,问题就是service.xml文件写错了。

我的XML文件如下:

<service name="XMLService">    <description>Web Service</description>    <parameter name="ServiceClass">com.demo.service.XMLService    </parameter>    <messageReceivers>        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"            class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"            class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />    </messageReceivers></service>

问题出在<parameter name="ServiceClass">,name我原来写成“XMLServiceClass”,发布时就会说没有Operations(操作),这个name属性有可能是固定的,改了就会错,或许是其它地方默认使用的parameter是ServiceClass吧。

0 0