Based on the wire log call from ESB is rerouted in the thire load balancer
and the host name is rewritten by the negix Overbalancer.
Hence, I have added *REQUEST_HOST_HEADER *property to enforce the host.


<api xmlns="http://ws.apache.org/ns/synapse"; name="test" context="/test">
   <resource methods="POST GET">
      <inSequence>
         <property name="DISABLE_CHUNKING" value="true"
scope="axis2"></property>
         *<property name="REQUEST_HOST_HEADER" value="www.eventbriteapi.com
<http://www.eventbriteapi.com>" scope="axis2"></property>*
         <send>
            <endpoint>
               <http method="post" uri-template="
https://www.eventbriteapi.com/v3/events/13981437857/discounts?token=HSX6X635TURH32K5CLMV
"></http>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <send></send>
      </outSequence>
   </resource>
</api>

On Mon, Dec 8, 2014 at 4:01 PM, Elilmatha Sivanesan <[email protected]>
wrote:

> Hi,
> Thany you Vanji  for your quick response, But for this url i was able to
> get the response. For the following url i'm getting the error:
>
> https://www.eventbriteapi.com/v3/events/13981437857/discounts/?token=HSX6X635TURH32K5CLMV
> <https://www.google.com/url?q=https%3A%2F%2Fwww.eventbriteapi.com%2Fv3%2Fevents%2F13981437857%2Fdiscounts%2F%3Ftoken%3DHSX6X635TURH32K5CLMV&sa=D&sntz=1&usg=AFQjCNFPMy3S6XxPzlrLkDs8vC4SmbuEsQ>
>  and
> the payload is
>
> {
> "discount.code": "133744467",
> "discount.percent_off": "1"
> }
>
> On Mon, Dec 8, 2014 at 3:30 PM, Vanjikumaran Sivajothy <[email protected]>
> wrote:
>
>> Hi Elilmatha,
>>
>> I did the quick testing on this with simple REST API[1] and i recivced
>> expected output [2].
>> So can you please add *POST_TO_URI *and  *DISABLE_CHUNKING *properties
>> into the request flow of your synapse configurations?
>>
>>
>> [1]
>> <api xmlns="http://ws.apache.org/ns/synapse"; name="test" context="/test">
>>    <resource methods="POST">
>>       <inSequence>
>>          *<property name="POST_TO_URI" value="true" scope="axis2"
>> type="STRING"></property>*
>> *         <property name="DISABLE_CHUNKING" value="true"
>> scope="axis2"></property>*
>>          <send>
>>             <endpoint>
>>                <http method="post" uri-template="
>> https://www.eventbriteapi.com:443/v3/events/13981437857/access_codes?token=HSX6X635TURH32K5CLMV
>> "></http>
>>             </endpoint>
>>          </send>
>>       </inSequence>
>>       <outSequence>
>>          <send></send>
>>       </outSequence>
>>    </resource>
>> </api>
>>
>>
>> [2]
>>
>>    -
>>
>>    {"access_codes": [{"resource_uri": 
>> "https://www.eventbriteapi.com/v3/events/13981437857/access_codes/133743657/";,
>>  "id": "133743657", "code": "123", "ticket_ids": ["30329833"], 
>> "quantity_available": 0, "start_date": null, "end_date": null, "event_id": 
>> "13981437857", "event": {"resource_uri": 
>> "https://www.eventbriteapi.com/v3/events/13981437857/";, "name": {"text": 
>> "cinimate", "html": "cinimate"}, "description": {"text": null, "html": 
>> null}, "logo": null, "id": "13981437857", "url": 
>> "http://www.eventbrite.com/e/cinimate-tickets-13981437857";, "logo_url": 
>> null, "start": {"timezone": "America/Los_Angeles", "local": 
>> "2014-12-30T19:00:00", "utc": "2014-12-31T03:00:00Z"}, "end": {"timezone": 
>> "America/Los_Angeles", "local": "2014-12-31T22:00:00", "utc": 
>> "2015-01-01T06:00:00Z"}, "created": "2014-10-28T03:47:32Z", "changed": 
>> "2014-12-08T04:33:33Z", "capacity": 300, "status": "live", "currency": 
>> "USD", "listed": true, "shareable": true, "invite_only": false, 
>> "online_event": false, "show_remaining": false, "organizer_id": 
>> "7637830159", "venue_id": "8806987", "category_id": null, "subcategory_id": 
>> null, "format_id": null}}, {"resource_uri": 
>> "https://www.eventbriteapi.com/v3/events/13981437857/access_codes/133743661/";,
>>  "id": "133743661", "code": "123", "ticket_ids": ["30329833"], 
>> "quantity_available": null, "start_date": null, "end_date": null, 
>> "event_id": "13981437857", "event": {"resource_uri": 
>> "https://www.eventbriteapi.com/v3/events/13981437857/";, "name": {"text": 
>> "cinimate", "html": "cinimate"}, "description": {"text": null, "html": 
>> null}, "logo": null, "id": "13981437857", "url": 
>> "http://www.eventbrite.com/e/cinimate-tickets-13981437857";, "logo_url": 
>> null, "start": {"timezone": "America/Los_Angeles", "local": 
>> "2014-12-30T19:00:00", "utc": "2014-12-31T03:00:00Z"}, "end": {"timezone": 
>> "America/Los_Angeles", "local": "2014-12-31T22:00:00", "utc": 
>> "2015-01-01T06:00:00Z"}, "created": "2014-10-28T03:47:32Z", "changed": 
>> "2014-12-08T04:33:33Z", "capacity": 300, "status": "live", "currency": 
>> "USD", "listed": true, "shareable": true, "invite_only": false, 
>> "online_event": false, "show_remaining": false, "organizer_id": 
>> "7637830159", "venue_id": "8806987", "category_id": null, "subcategory_id": 
>> null, "format_id": null}}, {"resource_uri": 
>> "https://www.eventbriteapi.com/v3/events/13981437857/access_codes/133744495/";,
>>  "id": "133744495", "code": "123", "ticket_ids": ["30329833"], 
>> "quantity_available": null, "start_date": null, "end_date": null, 
>> "event_id": "13981437857", "event": {"resource_uri": 
>> "https://www.eventbriteapi.com/v3/events/13981437857/";, "name": {"text": 
>> "cinimate", "html": "cinimate"}, "description": {"text": null, "html": 
>> null}, "logo": null, "id": "13981437857", "url": 
>> "http://www.eventbrite.com/e/cinimate-tickets-13981437857";, "logo_url": 
>> null, "start": {"timezone": "America/Los_Angeles", "local": 
>> "2014-12-30T19:00:00", "utc": "2014-12-31T03:00:00Z"}, "end": {"timezone": 
>> "America/Los_Angeles", "local": "2014-12-31T22:00:00", "utc": 
>> "2015-01-01T06:00:00Z"}, "created": "2014-10-28T03:47:32Z", "changed": 
>> "2014-12-08T04:33:33Z", "capacity": 300, "status": "live", "currency": 
>> "USD", "listed": true, "shareable": true, "invite_only": false, 
>> "online_event": false, "show_remaining": false, "organizer_id": 
>> "7637830159", "venue_id": "8806987", "category_id": null, "subcategory_id": 
>> null, "format_id": null}}], "pagination": {"object_count": 3, "page_number": 
>> 1, "page_size": 50, "page_count": 1}}
>>
>>
>>
>>
>>
>> On Mon, Dec 8, 2014 at 3:25 PM, Elilmatha Sivanesan <[email protected]>
>> wrote:
>>
>>> Hi all,
>>> I am getting 301 permanently moved error when I invoked the api endpoint
>>> through esb. But
>>> I am able to get the response when I directly invoked the same end point
>>> via the rest client.
>>>
>>> The cofig url :
>>>
>>> https://www.eventbriteapi.com/v3/events/13981437857/discounts/?token=HSX6X635TURH32K5CLMV
>>> <https://www.google.com/url?q=https%3A%2F%2Fwww.eventbriteapi.com%2Fv3%2Fevents%2F13981437857%2Fdiscounts%2F%3Ftoken%3DHSX6X635TURH32K5CLMV&sa=D&sntz=1&usg=AFQjCNFPMy3S6XxPzlrLkDs8vC4SmbuEsQ>
>>>
>>> and the payload :
>>> {
>>> "discount.code": "133744467",
>>> "discount.percent_off": "1"
>>> }
>>>
>>> I marked the end point to which the request is redirected. But the
>>> redirected url is not working through the rest client also. It gives 500
>>> internal server error.
>>>
>>> Wire log for the error:
>>>
>>>  [2014-12-08 14:49:51,508] DEBUG - wire >> "POST
>>> /services/createEventDiscount HTTP/1.1[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,508] DEBUG - wire >> "Host:
>>> elil-macbook-pro.local:8280[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,508] DEBUG - wire >> "Connection:
>>> keep-alive[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,508] DEBUG - wire >> "Content-Length: 71[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Cache-Control:
>>> no-cache[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Origin:
>>> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "User-Agent: Mozilla/5.0
>>> (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko)
>>> Chrome/39.0.2171.71 Safari/537.36[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Content-Type:
>>> application/json[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Accept: */*[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Accept-Encoding: gzip,
>>> deflate[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Accept-Language:
>>> en-US,en;q=0.8[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "Cookie:
>>> SERVERID=djc19[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "[\r][\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "{[\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "
>>> "eventId":"13981437857",[\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "  "code":"133744467",[\n]"
>>>
>>> [2014-12-08 14:49:51,509] DEBUG - wire >> "  "percentOff":"1"[\n]"
>>>
>>> [2014-12-08 14:49:51,510] DEBUG - wire >> "}"
>>>
>>> [2014-12-08 14:49:53,085] DEBUG - wire << "POST
>>> https://www.eventbriteapi.com/v3/events/13981437857/discounts?token=HSX6X635TURH32K5CLMV
>>>  HTTP/1.0[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,085] DEBUG - wire << "Accept-Language:
>>> en-US,en;q=0.8[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Cookie:
>>> SERVERID=djc19[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Accept-Encoding: gzip,
>>> deflate[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Origin:
>>> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Content-Type:
>>> application/x-www-form-urlencoded[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Accept: */*[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Cache-Control:
>>> no-cache[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Content-Length: 46[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Host: www.eventbriteapi.com:80
>>> [\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "Connection:
>>> Keep-Alive[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "User-Agent:
>>> Synapse-PT-HttpComponents-NIO[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,086] DEBUG - wire << "[\r][\n]"
>>>
>>> [2014-12-08 14:49:53,087] DEBUG - wire <<
>>> "discount.code=133744467&discount.percent_off=1"
>>>
>>> [2014-12-08 14:49:54,097] DEBUG - wire >> "HTTP/1.1 301 MOVED
>>> PERMANENTLY[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "Server: nginx[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "Date: Mon, 08 Dec 2014
>>> 09:17:18 GMT[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "Content-Type: text/html;
>>> charset=utf-8[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "Connection: close[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "x-xss-protection: 1;
>>> mode=block[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "x-content-type-options:
>>> nosniff[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "Location:
>>> https://www.eventbriteapi.com:80/v3/events/13981437857/discounts/?token=HSX6X635TURH32K5CLMV
>>> [\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "X-Frame-Options:
>>> SAMEORIGIN[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,098] DEBUG - wire >> "P3P: CP="NOI ADM DEV PSAi COM
>>> NAV OUR OTRo STP IND DEM"[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "X-UA-Compatible:
>>> IE=edge[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "Set-Cookie:
>>> SS=AE3DLHQcZVStvxCOwJE-5xpdFqeP8lfgxw; Domain=.eventbriteapi.com:80
>>> <http://eventbriteapi.com/>; httponly; Path=/; secure[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "Set-Cookie: mgref=typeins;
>>> Domain=.eventbriteapi.com:80 <http://eventbriteapi.com/>; expires=Tue,
>>> 08-Dec-2015 09:17:17 GMT; httponly; Max-Age=31536000; Path=/[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "Set-Cookie: mgrefby=; Domain=.
>>> eventbriteapi.com:80 <http://eventbriteapi.com/>; expires=Tue,
>>> 08-Dec-2015 09:17:17 GMT; httponly; Max-Age=31536000; Path=/[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "Set-Cookie:
>>> SP=AGQgbbl_C3YTaVUC9tSbn-CtVKPP9-x5x4Tv2EUGDAmujG9qtuXuzWOimCM20fzpNnuBHGZpghhla-5OiEBPdZbLyd0OH7PfOFjisPfhqlZcnNlAXsEd-wH3ERHrG4GxXBV_U4L8fyBKpuqTL-EocxDoYjgBQhWKTmxHgWSZIcoc9gMNVs2IZ3N8p-fQRcJ5krlBs-fwo5IWWXuAYr-l-OFT3cAHbH9QlPOY0rXUK4kJWx3BE0VYj5c;
>>> Domain=.eventbriteapi.com:80 <http://eventbriteapi.com/>; httponly;
>>> Path=/[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "Set-Cookie: AN=; expires=Thu,
>>> 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,099] DEBUG - wire >> "[\r][\n]"
>>>
>>> [2014-12-08 14:49:54,369] ERROR - RelayUtils Error while building
>>> Passthrough stream
>>>
>>> org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException:
>>> ParseError at [row,col]:[1,1]
>>>
>>> Message: Premature end of file.
>>>
>>> What could be the reason for this issue.
>>>
>>> Thank you,
>>>
>>> --
>>> *S.Elilmatha*
>>> Associate  Software Engineer,
>>>
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> Mobile 0779842221.
>>>
>>>
>>
>>
>> --
>> Sivajothy Vanjikumaran
>> *Senior Software Engineer*
>> *Integration Technologies Team*
>> *WSO2 Inc. http://wso2.com <http://wso2.com/>*
>> *Mobile:(+94)777219209*
>> [image: Facebook] <https://www.facebook.com/vanjikumaran> [image:
>> Twitter] <https://twitter.com/vanjikumaran> [image: LinkedIn]
>> <http://www.linkedin.com/pub/vanjikumaran-sivajothy/25/b31/293> [image:
>> Blogger] <http://vanjikumaran.blogspot.com/> [image: SlideShare]
>> <http://www.slideshare.net/vanjikumaran>
>>
>> This communication may contain privileged or other
>> confidential information and is intended exclusively for the addressee/s.
>> If you are not the intended recipient/s, or believe that you may
>> have received this communication in error, please reply to the
>> sender indicating that fact and delete the copy you received and in
>> addition, you should not print, copy, re-transmit, disseminate, or
>> otherwise use the information contained in this communication.
>> Internet communications cannot be guaranteed to be timely, secure, error
>> or virus-free. The sender does not accept liability for any errors
>> or omissions
>>
>
>
>
> --
> *S.Elilmatha*
> Associate  Software Engineer,
>
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile 0779842221.
>
>


-- 
Sivajothy Vanjikumaran
*Senior Software Engineer*
*Integration Technologies Team*
*WSO2 Inc. http://wso2.com <http://wso2.com/>*
*Mobile:(+94)777219209*
[image: Facebook] <https://www.facebook.com/vanjikumaran> [image: Twitter]
<https://twitter.com/vanjikumaran> [image: LinkedIn]
<http://www.linkedin.com/pub/vanjikumaran-sivajothy/25/b31/293> [image:
Blogger] <http://vanjikumaran.blogspot.com/> [image: SlideShare]
<http://www.slideshare.net/vanjikumaran>

This communication may contain privileged or other confidential information
and is intended exclusively for the addressee/s. If you are not the
intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print,
copy, re-transmit, disseminate, or otherwise use the information contained
in this communication. Internet communications cannot be guaranteed to be
timely, secure, error or virus-free. The sender does not accept liability
for any errors or omissions
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to