gpt4 book ai didi

error-handling - 没有这样的操作: HTTP GET PATH_INFO:/services/EchoUMO

转载 作者:行者123 更新时间:2023-12-03 08:58:39 24 4
gpt4 key购买 nike

我从互联网上下载了回声样本。我有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>

最佳答案

您的类(class)没有使用JAX-WS批注,因此您会收到错误。

您有2个选择:

  • 保留当前类并使用simple service,即<cxf:simple-service serviceClass="org.mule.example.echo.Echo"/>
  • 按照说明here
  • 向您的POJO添加JAX-WS批注

    关于error-handling - 没有这样的操作: HTTP GET PATH_INFO:/services/EchoUMO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15199427/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com