0
votes

I have a rails app exposed an rest json interface like: http://foo.com/agency/:name.json I have written a wso2 esb api config to access the 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>

when I tested the wso2 esb api using curl, I get

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

And the ESB log write

[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

seems endpoint url translate is not work.

How to correct my API config to make it work? Thx

1

1 Answers

0
votes

Try changing the scope="axis2" to scope="transport" and removing format="pox" from the address endpoint.