0

我在 wso2 ESB 中创建了一个 API:

<api xmlns="http://ws.apache.org/ns/synapse" name="getUUIDAPI" context="/getUUID">
   <resource methods="GET" uri-template="?Name={searchValue}" inSequence="getUUIDIN" outSequence="CommonJsonOut"/>
</api>

它给了我一个 API 调用 URL 为http://10.224.64.97:8280/getUUID. 现在,当我在浏览器中尝试这个休息服务时:

http://10.224.64.97:8280/getUUID?Name=uvu 

,在esb中我得到错误:

TID: [0] [ESB] [2013-06-26 10:25:50,796] ERROR {org.apache.axis2.description.ClientUtils} -  The system cannot infer the transport information from the 
/getUUID?Name=uvu?Name=uvu URL. {org.apache.axis2.description.ClientUtils}
TID: [0] [ESB] [2013-06-26 10:25:50,796] ERROR {org.apache.synapse.core.axis2.Axis2Sender} -  Unexpected error during sending message out {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: The system cannot infer the transport information from the /getUUID?Name=uvu?Name=uvu URL.
    at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
    at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:115)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
    at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:456)
    at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:316)
    at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
    at org.apache.synapse.endpoints.WSDLEndpoint.send(WSDLEndpoint.java:69)
    at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:54)
    at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
    at org.apache.synapse.rest.Resource.process(Resource.java:306)
    at org.apache.synapse.rest.API.process(API.java:308)
    at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
    at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182)
    at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:367)
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:204)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

正如您在上面的错误中看到的那样,它正在点击的网址是,/getUUID?Name=uvu?Name=uvu 但我正在发送/getUUID?Name=uvu。为什么我收到这个奇怪的错误?如果我将 api 文件、与 api 关联的序列复制到其他服务器的 esb,然后我点击上面的 url,我会得到响应。请帮助我。提前致谢

4

1 回答 1

0

定义这样的东西;

uri-template="/{searchValue}"
于 2013-06-26T13:15:48.787 回答