My understanding from https://issues.apache.org/jira/browse/SYNAPSE-365
and https://issues.apache.org/jira/browse/SYNAPSE-412  is that I can
setup a RESTProxy and call that proxy - essentially as a passthrough and
expect the same response as if I had invoked the REST service directly.
I have a fairly simple GET on a resource that returns an xml response if
I call it directly, but if I attempt a GET on the resource through my
Synapse Proxy, the Response is a 301 - Moved Permanently. I'm hoping
that you can shed some light on what I might be doing wrong. Thanks!

 

I am using a SNAPSHOT build that I downloaded last night and the Synapse
config is as follows:

 

<syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse";>

    <syn:proxy name="RESTTxnService" startOnLoad="true" >

        <syn:target>

            <syn:endpoint>

                <syn:address
uri="http://host0925.pharos.intuit.com:8080/sb/customer/v1/102099219";
format="get" trace="enable" />

            </syn:endpoint>

            <syn:outSequence>

                <syn:send/>

            </syn:outSequence>

        </syn:target>

    </syn:proxy>

</syn:definitions>

 

The Request, Response and Synapse output:

 

GET /services/RESTTxnService HTTP/1.1

User-Agent: Fiddler

Host: localhost:8280

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/xaml+xml,
application/vnd.ms-xpsdocument, application/x-ms-xbap,
application/x-ms-application, application/x-shockwave-flash, */*

Accept-Language: en-us

UA-CPU: x86

Content-Type: text/xml

Accept-Encoding: gzip, deflate

Cookie: locationValue=<cookie stuff>

Connection: Keep-Alive

Authorization: <auth stuff>

 

HTTP/1.1 301 Moved Permanently

Location: /services/

Date: Fri, 13 Feb 2009 17:09:54 GMT

Server: Synapse-HttpComponents-NIO

Transfer-Encoding: chunked

Connection: Keep-Alive

 

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG ServerH

andler HTTP connection [/127.0.0.1:3896]: Connected

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG ServerH

andler HTTP connection [/127.0.0.1:3896]: GET /services/RESTTxnService
HTTP/1.1

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> GET /services/RESTTxnService HTTP/1.1

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> User-Agent: Fiddler

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Host: localhost:8280

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, applicati

on/vnd.ms-powerpoint, application/msword, application/xaml+xml,
application/vnd.ms-xpsdocument, appl

ication/x-ms-xbap, application/x-ms-application,
application/x-shockwave-flash, */*

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Accept-Language: en-us

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> UA-CPU: x86

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Content-Type: text/xml

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Accept-Encoding: gzip, deflate

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Cookie: locationValue=<cookie info>

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Connection: Keep-Alive

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG headers

 >> Authorization: <auth stuff>

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG ServerH

andler HTTP connection [/127.0.0.1:3896]: Output ready

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG ServerH

andler HTTP connection [closed]: Content encoder [chunk-coded;
completed: true]

2009-02-13 09:09:54,983 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-1] DEBUG ServerH

andler HTTP connection [closed]: Closed

 

 

 

If I attempt a GET on just /services then I see my Snapse Proxy is
available - apparently as a SOAP based service ("RESTTxnService?wsdl").
Again, the Request, Response, and Synapse output follows:

 

GET /services HTTP/1.1

User-Agent: Fiddler

Host: localhost:8280

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/xaml+xml,
application/vnd.ms-xpsdocument, application/x-ms-xbap,
application/x-ms-application, application/x-shockwave-flash, */*

Accept-Language: en-us

UA-CPU: x86

Content-Type: text/xml

Accept-Encoding: gzip, deflate

Cookie: <cookie>

Connection: Keep-Alive

Authorization: <auth>

 

HTTP/1.1 200 OK

Content-Type: text/html

Date: Fri, 13 Feb 2009 17:35:06 GMT

Server: Synapse-HttpComponents-NIO

Connection: Keep-Alive

Content-Length: 301

 

<html><head><title>Axis2: Services</title></head><body><h2>Deployed
services</h2><h3><a
href="RESTTxnService?wsdl">RESTTxnService</a></h3>Available operations
<ul><li>mediate</li></ul><hr><h2><font color="blue">Faulty
Services</font></h2><h3><font
color="blue">RESTTxnService</font></h3></body></html>

 

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG ServerH

andler HTTP connection [/127.0.0.1:3983]: Connected

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG ServerH

andler HTTP connection [/127.0.0.1:3983]: GET /services HTTP/1.1

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> GET /services HTTP/1.1

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> User-Agent: Fiddler

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Host: localhost:8280

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, applicati

on/vnd.ms-powerpoint, application/msword, application/xaml+xml,
application/vnd.ms-xpsdocument, appl

ication/x-ms-xbap, application/x-ms-application,
application/x-shockwave-flash, */*

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Accept-Language: en-us

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> UA-CPU: x86

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Content-Type: text/xml

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Accept-Encoding: gzip, deflate

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Cookie: locationValue=san_diego;
s_vi=[CS]v1|492B127700007F88-A3A0942000039BB[CE]; s_cc=true; s_

sq=%5B%5BB%5D%5D; INTUIT_SESSIONID=c17Sr0PfzPjarKH75RPt9g**.g31-2;
SHOPPER_USER_ID=1687295976

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Connection: Keep-Alive

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG headers

 >> Authorization: Basic QWxtaXJhOmludHVpdA==

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG ServerH

andler HTTP connection [/127.0.0.1:3983]: Output ready

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG ServerH

andler HTTP connection [closed]: Content encoder [chunk-coded;
completed: true]

2009-02-13 09:35:06,158 [172.18.50.117-SDGD04LKCKRDW] [http-Listener I/O
dispatcher-2] DEBUG ServerH

andler HTTP connection [closed]: Closed

Reply via email to