0

我有一个rails应用程序暴露了一个rest json接口,例如:http: //foo.com/agency/ : name.json 我已经编写了一个wso2 esb api配置来访问api

   <api name="agency" context="/agency">
      <resource methods="GET" uri-template="/view/{name}">
         <inSequence>
            <property name="REST_URL_POSTFIX"
                      expression="fn:concat('/',get-property('uri.var.name'), '.json')"
                      scope="axis2"/>
            <send>
               <endpoint>
                  <address uri="http://foo.com/agency/" format="pox"/>
               </endpoint>
            </send>
         </inSequence>
         <outSequence>
            <send/>
         </outSequence>
      </resource>
   </api>

当我使用 curl 测试 wso2 esb api 时,我得到了

\dev\curl-w32>curl http://192.168.181.132:8280/agency/view/blah-blah
curl: (52) Empty reply from server

以及 ESB 日志写入

[2013-11-14 16:17:49,047]  INFO - LogMediator To: /agency/view/blah-blah, MessageID: urn:uuid:d0a4c4ec-7600-430d-bb52-e580b
6ec2516, Direction: request, MESSAGE = Executing default 'fault' sequence, ERROR
_CODE = 101500, ERROR_MESSAGE = Error in Sender, Envelope: <?xml version='1.0' e
ncoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap
-envelope"><soapenv:Body/></soapenv:Envelope>
[2013-11-14 16:18:49,063]  WARN - SourceHandler Connection time out after reques
t is read: http-incoming-48

似乎端点 url 翻译不起作用。

如何更正我的 API 配置以使其正常工作?谢谢

4

1 回答 1

0

尝试将 scope="axis2" 更改为 scope="transport" 并从地址端点中删除 format="pox"。

于 2013-11-20T18:22:25.287 回答