0

我从互联网下载了骡子的回声样本。我有 1 个 java 类

package org.mule.example.echo;

public class Echo
{
    public Echo()
    {
    }

    public String echo(String string)
    {
        return string;
    }
}

还有一个xml文件

 <?xml version="1.0" encoding="UTF-8"?>
 <mule> 

 <flow name="EchoFlow">
        <inbound-endpoint address=":65082/services/EchoUMO" exchange-pattern="request-response"/>
        <cxf:jaxws-service serviceClass="org.mule.example.echo.Echo"/>
        <component>
            <singleton-object class="org.mule.example.echo.Echo" />
        </component>
    </flow>
</mule>

当我在浏览器中写 :65082/services/EchoUMO 时,我没有得到任何好的结果。在我的控制台中,我看到了这个错误:

 WARN  2013-03-04 12:08:10,713 [[sample-echo].connector.http.mule.default.receiver.02] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://echo.example.mule.org/}EchoService has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No such operation:  (HTTP GET PATH_INFO: /services/EchoUMO)
    at org.apache.cxf.interceptor.URIMappingInterceptor.handleMessage(URIMappingInterceptor.java:88)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)

你能解释一下我发生了什么事吗?

当我在浏览器中写入:65082/services/EchoUMO时,我的浏览器会显示此页面:

<soap:Envelope>
    <soap:Body><soap:Fault>
        <faultcode>soap:Server</faultcode>
        <faultstring>No such operation: (HTTP GET PATH_INFO: /services/EchoUMO)</faultstring>
    </soap:Fault></soap:Body>
</soap:Envelope>
4

1 回答 1

0

您的类不使用 JAX-WS 注释,因此您会收到错误消息。

您有 2 个选择:

  1. 保留当前类并使用简单的服务,即<cxf:simple-service serviceClass="org.mule.example.echo.Echo"/>
  2. 如此处所述,将 JAX-WS 注释添加到您的POJO
于 2013-03-04T16:20:03.507 回答