Re: [Dev] [Stripe ESB Connector] Getting 400 Bad Request Error

2014-12-11 Thread Keerthika Mahendralingam
Thank you Vanji, I tried as you suggested. Now I am able to get the correct
response.

On Thu, Dec 11, 2014 at 1:32 PM, Vanjikumaran Sivajothy 
wrote:

> Hi Keethika,
>
> Please use the http endpoint to resolve this issue.
>
>
>  
>* *
> *uri-template="https://api.stripe.com/v1/charges/{uri.var.chargeId}/refunds
> ">*
> **
>  
>
>
>
>
>
> On Thu, Dec 11, 2014 at 11:01 AM, Keerthika Mahendralingam <
> keerth...@wso2.com> wrote:
>
>> Thank you Vanji for your quick response. I tried your suggested method.
>> But when I hardcoded the value for chageId and send the post request with
>> the payload from the rest client the empty payload was removed and correct
>> request was sent.
>> But when I try to get the chargeId from the payload removes the message
>> context also *> scope="axis2" type="BOOLEAN"/>* removes the message context also.
>> Please find the wire log:
>> [2014-12-11 11:01:03,568] DEBUG - wire >> "POST /strip HTTP/1.1[\r][\n]"
>> [2014-12-11 11:01:03,568] DEBUG - wire >> "Host: 10.100.5.169:8280[\r][\n]"
>> [2014-12-11 11:01:03,568] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
>> [2014-12-11 11:01:03,568] DEBUG - wire >> "Content-Length: 44[\r][\n]"
>> [2014-12-11 11:01:03,568] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"
>> [2014-12-11 11:01:03,568] DEBUG - wire >> "Origin:
>> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" [2014-12-11
>> 11:01:03,568] DEBUG - wire >> "User-Agent: Mozilla/5.0 (Macintosh; Mac OS X
>> 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71
>> Safari/537.36[\r][\n]" [2014-12-11 11:01:03,568] DEBUG - wire >>
>> "Content-Type: application/json[\r][\n]" [2014-12-11 11:01:03,568] DEBUG -
>> wire >> "Accept: */*[\r][\n]" [2014-12-11 11:01:03,568] DEBUG - wire >>
>> "Accept-Encoding: gzip, deflate[\r][\n]" [2014-12-11 11:01:03,569] DEBUG -
>> wire >> "Accept-Language: en-US,en;q=0.8[\r][\n]" [2014-12-11 11:01:03,569]
>> DEBUG - wire >> "[\r][\n]" [2014-12-11 11:01:03,569] DEBUG - wire >>
>> "{[\n]" [2014-12-11 11:01:03,569] DEBUG - wire >> "
>> *"chargeId":"ch_158NuEDpl35Wu2ui6atArh0E"*[\n]" [2014-12-11
>> 11:01:03,570] DEBUG - wire >> "}" [2014-12-11 11:01:03,571] DEBUG -
>> headers http-incoming-2 >> POST /strip HTTP/1.1 [2014-12-11 11:01:03,571]
>> DEBUG - headers http-incoming-2 >> Host: 10.100.5.169:8280 [2014-12-11
>> 11:01:03,571] DEBUG - headers http-incoming-2 >> Connection: keep-alive
>> [2014-12-11 11:01:03,571] DEBUG - headers http-incoming-2 >>
>> Content-Length: 44 [2014-12-11 11:01:03,571] DEBUG - headers
>> http-incoming-2 >> Cache-Control: no-cache [2014-12-11 11:01:03,571] DEBUG
>> - headers http-incoming-2 >> Origin:
>> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm [2014-12-11
>> 11:01:03,572] DEBUG - headers http-incoming-2 >> User-Agent: Mozilla/5.0
>> (Macintosh; ss Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko)
>> Chrome/39.0.2171.71 Safari/537.36 [2014-12-11 11:01:03,572] DEBUG - headers
>> http-incoming-2 >> Content-Type: application/json [2014-12-11 11:01:03,572]
>> DEBUG - headers http-incoming-2 >> Accept: */* [2014-12-11 11:01:03,572]
>> DEBUG - headers http-incoming-2 >> Accept-Encoding: gzip, deflate
>> [2014-12-11 11:01:03,572] DEBUG - headers http-incoming-2 >>
>> Accept-Language: en-US,en;q=0.8 [2014-12-11 11:01:03,572] DEBUG - headers
>> http-incoming-2 >> Cookie: MSG14178730176680.29427175505634384=true;
>> MSG14178733498110.13085054063584778=true;
>> MSG14178733599110.6219386089528006=true;
>> MSG14178737859670.9529352123700151=true;
>> MSG14178737969220.7098197557439472=true;
>> MSG14178742229450.11304979617306088=true;
>> MSG14178742459580.08636783896345823=true;
>> MSG14178743775100.8277019213681849=true;
>> MSG14178744009480.1176885444149115=true;
>> MSG14178744961220.12665969302078872=true;
>> MSG14178745125470.7059473583386973=true;
>> MSG14178746301280.5421815401876321=true;
>> MSG14178749920270.16922145677337863=true;
>> MSG14178750099790.9279498346279079=true;
>> MSG14178752074000.7968266996983095=true;
>> MSG14178752284520.3200580037079722=true;
>> MSG14178759605060.21670383101954604=true;
>> MSG14178759719000.4556431273477163=true;
>> MSG14178760965150.9435498284164892=true;
>> MSG14178761060100.2838820086933652=true;
>> MSG14179410733150.9565482556718199=true;
>> MSG14179410950800.04846375334425135=true;
>> MSG14179455481590.07412600774150879=true;
>> MSG14179455562460.4402089613229584=true;
>> MSG14179456372820.13647268855455874=true;
>> MSG14179456467490.9615653270227574=true;
>> MSG14179457888170.3561121989855156=true;
>> MSG14179458087970.3274270139955=true;
>> MSG14179458931480.43382225798195906=true;
>> MSG14179459297600.020534603827859765=true;
>> MSG14179459966390.6664658852131142=true;
>> MSG14179460204050.14013169399751735=true;
>> MSG14179489015150.06760873851129723=true;
>> MSG14179489099060.5499165139086787=true;
>> MSG14179491204370.12483201997664095=true;

Re: [Dev] [Stripe ESB Connector] Getting 400 Bad Request Error

2014-12-11 Thread Vanjikumaran Sivajothy
Hi Keethika,

Please use the http endpoint to resolve this issue.


 
   * *
*   https://api.stripe.com/v1/charges/{uri.var.chargeId}/refunds
">*
**
 





On Thu, Dec 11, 2014 at 11:01 AM, Keerthika Mahendralingam <
keerth...@wso2.com> wrote:

> Thank you Vanji for your quick response. I tried your suggested method.
> But when I hardcoded the value for chageId and send the post request with
> the payload from the rest client the empty payload was removed and correct
> request was sent.
> But when I try to get the chargeId from the payload removes the message
> context also * scope="axis2" type="BOOLEAN"/>* removes the message context also.
> Please find the wire log:
> [2014-12-11 11:01:03,568] DEBUG - wire >> "POST /strip HTTP/1.1[\r][\n]"
> [2014-12-11 11:01:03,568] DEBUG - wire >> "Host: 10.100.5.169:8280[\r][\n]"
> [2014-12-11 11:01:03,568] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
> [2014-12-11 11:01:03,568] DEBUG - wire >> "Content-Length: 44[\r][\n]"
> [2014-12-11 11:01:03,568] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"
> [2014-12-11 11:01:03,568] DEBUG - wire >> "Origin:
> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" [2014-12-11
> 11:01:03,568] DEBUG - wire >> "User-Agent: Mozilla/5.0 (Macintosh; Mac OS X
> 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71
> Safari/537.36[\r][\n]" [2014-12-11 11:01:03,568] DEBUG - wire >>
> "Content-Type: application/json[\r][\n]" [2014-12-11 11:01:03,568] DEBUG -
> wire >> "Accept: */*[\r][\n]" [2014-12-11 11:01:03,568] DEBUG - wire >>
> "Accept-Encoding: gzip, deflate[\r][\n]" [2014-12-11 11:01:03,569] DEBUG -
> wire >> "Accept-Language: en-US,en;q=0.8[\r][\n]" [2014-12-11 11:01:03,569]
> DEBUG - wire >> "[\r][\n]" [2014-12-11 11:01:03,569] DEBUG - wire >>
> "{[\n]" [2014-12-11 11:01:03,569] DEBUG - wire >> "
> *"chargeId":"ch_158NuEDpl35Wu2ui6atArh0E"*[\n]" [2014-12-11 11:01:03,570]
> DEBUG - wire >> "}" [2014-12-11 11:01:03,571] DEBUG - headers
> http-incoming-2 >> POST /strip HTTP/1.1 [2014-12-11 11:01:03,571] DEBUG -
> headers http-incoming-2 >> Host: 10.100.5.169:8280 [2014-12-11
> 11:01:03,571] DEBUG - headers http-incoming-2 >> Connection: keep-alive
> [2014-12-11 11:01:03,571] DEBUG - headers http-incoming-2 >>
> Content-Length: 44 [2014-12-11 11:01:03,571] DEBUG - headers
> http-incoming-2 >> Cache-Control: no-cache [2014-12-11 11:01:03,571] DEBUG
> - headers http-incoming-2 >> Origin:
> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm [2014-12-11
> 11:01:03,572] DEBUG - headers http-incoming-2 >> User-Agent: Mozilla/5.0
> (Macintosh; ss Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko)
> Chrome/39.0.2171.71 Safari/537.36 [2014-12-11 11:01:03,572] DEBUG - headers
> http-incoming-2 >> Content-Type: application/json [2014-12-11 11:01:03,572]
> DEBUG - headers http-incoming-2 >> Accept: */* [2014-12-11 11:01:03,572]
> DEBUG - headers http-incoming-2 >> Accept-Encoding: gzip, deflate
> [2014-12-11 11:01:03,572] DEBUG - headers http-incoming-2 >>
> Accept-Language: en-US,en;q=0.8 [2014-12-11 11:01:03,572] DEBUG - headers
> http-incoming-2 >> Cookie: MSG14178730176680.29427175505634384=true;
> MSG14178733498110.13085054063584778=true;
> MSG14178733599110.6219386089528006=true;
> MSG14178737859670.9529352123700151=true;
> MSG14178737969220.7098197557439472=true;
> MSG14178742229450.11304979617306088=true;
> MSG14178742459580.08636783896345823=true;
> MSG14178743775100.8277019213681849=true;
> MSG14178744009480.1176885444149115=true;
> MSG14178744961220.12665969302078872=true;
> MSG14178745125470.7059473583386973=true;
> MSG14178746301280.5421815401876321=true;
> MSG14178749920270.16922145677337863=true;
> MSG14178750099790.9279498346279079=true;
> MSG14178752074000.7968266996983095=true;
> MSG14178752284520.3200580037079722=true;
> MSG14178759605060.21670383101954604=true;
> MSG14178759719000.4556431273477163=true;
> MSG14178760965150.9435498284164892=true;
> MSG14178761060100.2838820086933652=true;
> MSG14179410733150.9565482556718199=true;
> MSG14179410950800.04846375334425135=true;
> MSG14179455481590.07412600774150879=true;
> MSG14179455562460.4402089613229584=true;
> MSG14179456372820.13647268855455874=true;
> MSG14179456467490.9615653270227574=true;
> MSG14179457888170.3561121989855156=true;
> MSG14179458087970.3274270139955=true;
> MSG14179458931480.43382225798195906=true;
> MSG14179459297600.020534603827859765=true;
> MSG14179459966390.6664658852131142=true;
> MSG14179460204050.14013169399751735=true;
> MSG14179489015150.06760873851129723=true;
> MSG14179489099060.5499165139086787=true;
> MSG14179491204370.12483201997664095=true;
> MSG14179491378060.04953538185644113=true;
> MSG14179495124730.1470145124103216=true;
> MSG14179495216360.5932151724208592=true;
> MSG14180160515350.3206177291762258=true;
> MSG14180160586290.21535470793461686=true;
> MSG14180180629350.34373419260761984=true;
> MSG141801

Re: [Dev] [Stripe ESB Connector] Getting 400 Bad Request Error

2014-12-10 Thread Keerthika Mahendralingam
Thank you Vanji for your quick response. I tried your suggested method. But
when I hardcoded the value for chageId and send the post request with the
payload from the rest client the empty payload was removed and correct
request was sent.
But when I try to get the chargeId from the payload removes the message
context also ** removes the message context also.
Please find the wire log:
[2014-12-11 11:01:03,568] DEBUG - wire >> "POST /strip HTTP/1.1[\r][\n]"
[2014-12-11 11:01:03,568] DEBUG - wire >> "Host: 10.100.5.169:8280[\r][\n]"
[2014-12-11 11:01:03,568] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
[2014-12-11 11:01:03,568] DEBUG - wire >> "Content-Length: 44[\r][\n]"
[2014-12-11 11:01:03,568] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"
[2014-12-11 11:01:03,568] DEBUG - wire >> "Origin:
chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]" [2014-12-11
11:01:03,568] 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-11 11:01:03,568] DEBUG - wire >>
"Content-Type: application/json[\r][\n]" [2014-12-11 11:01:03,568] DEBUG -
wire >> "Accept: */*[\r][\n]" [2014-12-11 11:01:03,568] DEBUG - wire >>
"Accept-Encoding: gzip, deflate[\r][\n]" [2014-12-11 11:01:03,569] DEBUG -
wire >> "Accept-Language: en-US,en;q=0.8[\r][\n]" [2014-12-11 11:01:03,569]
DEBUG - wire >> "[\r][\n]" [2014-12-11 11:01:03,569] DEBUG - wire >>
"{[\n]" [2014-12-11 11:01:03,569] DEBUG - wire >> "
*"chargeId":"ch_158NuEDpl35Wu2ui6atArh0E"*[\n]" [2014-12-11 11:01:03,570]
DEBUG - wire >> "}" [2014-12-11 11:01:03,571] DEBUG - headers
http-incoming-2 >> POST /strip HTTP/1.1 [2014-12-11 11:01:03,571] DEBUG -
headers http-incoming-2 >> Host: 10.100.5.169:8280 [2014-12-11
11:01:03,571] DEBUG - headers http-incoming-2 >> Connection: keep-alive
[2014-12-11 11:01:03,571] DEBUG - headers http-incoming-2 >>
Content-Length: 44 [2014-12-11 11:01:03,571] DEBUG - headers
http-incoming-2 >> Cache-Control: no-cache [2014-12-11 11:01:03,571] DEBUG
- headers http-incoming-2 >> Origin:
chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm [2014-12-11
11:01:03,572] DEBUG - headers http-incoming-2 >> 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 [2014-12-11 11:01:03,572] DEBUG - headers
http-incoming-2 >> Content-Type: application/json [2014-12-11 11:01:03,572]
DEBUG - headers http-incoming-2 >> Accept: */* [2014-12-11 11:01:03,572]
DEBUG - headers http-incoming-2 >> Accept-Encoding: gzip, deflate
[2014-12-11 11:01:03,572] DEBUG - headers http-incoming-2 >>
Accept-Language: en-US,en;q=0.8 [2014-12-11 11:01:03,572] DEBUG - headers
http-incoming-2 >> Cookie: MSG14178730176680.29427175505634384=true;
MSG14178733498110.13085054063584778=true;
MSG14178733599110.6219386089528006=true;
MSG14178737859670.9529352123700151=true;
MSG14178737969220.7098197557439472=true;
MSG14178742229450.11304979617306088=true;
MSG14178742459580.08636783896345823=true;
MSG14178743775100.8277019213681849=true;
MSG14178744009480.1176885444149115=true;
MSG14178744961220.12665969302078872=true;
MSG14178745125470.7059473583386973=true;
MSG14178746301280.5421815401876321=true;
MSG14178749920270.16922145677337863=true;
MSG14178750099790.9279498346279079=true;
MSG14178752074000.7968266996983095=true;
MSG14178752284520.3200580037079722=true;
MSG14178759605060.21670383101954604=true;
MSG14178759719000.4556431273477163=true;
MSG14178760965150.9435498284164892=true;
MSG14178761060100.2838820086933652=true;
MSG14179410733150.9565482556718199=true;
MSG14179410950800.04846375334425135=true;
MSG14179455481590.07412600774150879=true;
MSG14179455562460.4402089613229584=true;
MSG14179456372820.13647268855455874=true;
MSG14179456467490.9615653270227574=true;
MSG14179457888170.3561121989855156=true;
MSG14179458087970.3274270139955=true;
MSG14179458931480.43382225798195906=true;
MSG14179459297600.020534603827859765=true;
MSG14179459966390.6664658852131142=true;
MSG14179460204050.14013169399751735=true;
MSG14179489015150.06760873851129723=true;
MSG14179489099060.5499165139086787=true;
MSG14179491204370.12483201997664095=true;
MSG14179491378060.04953538185644113=true;
MSG14179495124730.1470145124103216=true;
MSG14179495216360.5932151724208592=true;
MSG14180160515350.3206177291762258=true;
MSG14180160586290.21535470793461686=true;
MSG14180180629350.34373419260761984=true;
MSG14180180771320.43280719820494484=true;
MSG14180183718290.7533101304562387=true;
MSG14180183793000.3531918009854791=true;
MSG14180187292670.3233565871754088=true;
MSG14180187481570.19749683627420767=true;
MSG14180188821080.7404282564701233=true;
MSG14180188986720.5087172081446473=true;
MSG14180195868500.9925920539609546=true;
MSG14180196038340.36159794798652867=true;
MSG14180196296280.7191546107618206=true;
MSG14180200404930.846025712109372=true;
MSG14180200498980.3576538787263849=true;
MSG14180211287070.6981240320779332=true;
MSG14

[Dev] [Stripe ESB Connector] Getting 400 Bad Request Error

2014-12-10 Thread Keerthika Mahendralingam
Hi all,
I am trying to send a post request to https://api.stripe.com/v1/charges/

{CHARGE_ID}/refunds.
There are some optional parameters for this request. When I invoked the
endpoint through esb with the optional parameters I am able to get the
expected response. But if I invoked the endpoint without the optional
parameters, an additional body is sent with the request.
Please find the wire log for the both requests with optional
parameters and mandatory
parameter :

*Wire log for the request with optional parameter:*

[2014-12-11 09:35:54,151] DEBUG - wire >> "POST
/services/stripe_createANewRefund HTTP/1.1[\r][\n]"

[2014-12-11 09:35:54,151] DEBUG - wire >> "Host:
keerthikas-macbook-pro.local:8280[\r][\n]"

[2014-12-11 09:35:54,151] DEBUG - wire >> "Connection: keep-alive[\r][\n]"

[2014-12-11 09:35:54,151] DEBUG - wire >> "Content-Length: 61[\r][\n]"

[2014-12-11 09:35:54,151] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"

[2014-12-11 09:35:54,151] DEBUG - wire >> "Origin:
chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]"

[2014-12-11 09:35:54,151] 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-11 09:35:54,152] DEBUG - wire >> "Content-Type:
application/json[\r][\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "Accept: */*[\r][\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "Accept-Encoding: gzip,
deflate[\r][\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "Accept-Language:
en-US,en;q=0.8[\r][\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "Cookie: SERVERID=djc19[\r][\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "[\r][\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "{[\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >>
""chargeId":"ch_158NuEDpl35Wu2ui6atArh0E",[\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "  "amount":"50"[\n]"

[2014-12-11 09:35:54,152] DEBUG - wire >> "}"

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> POST
/services/stripe_createANewRefund HTTP/1.1

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Host:
keerthikas-macbook-pro.local:8280

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Connection:
keep-alive

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >>
Content-Length: 61

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Cache-Control:
no-cache

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Origin:
chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> 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

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Content-Type:
application/json

[2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Accept: */*

[2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >>
Accept-Encoding: gzip, deflate

[2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >>
Accept-Language: en-US,en;q=0.8

[2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >> Cookie:
SERVERID=djc19

[2014-12-11 09:35:54,156] ERROR - SynapseJsonPath #stringValueOf. Error
evaluating JSON Path <$.refundApplicationFee>. Returning empty result.
Error>>> invalid path

[2014-12-11 09:35:54,156] ERROR - SynapseJsonPath #stringValueOf. Error
evaluating JSON Path <$.reason>. Returning empty result. Error>>> invalid
path

[2014-12-11 09:35:54,157] ERROR - SynapseJsonPath #stringValueOf. Error
evaluating JSON Path <$.metadata>. Returning empty result. Error>>> invalid
path

[2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> POST
/v1/charges/ch_158NuEDpl35Wu2ui6atArh0E/refunds HTTP/1.1

[2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >>
Accept-Language: en-US,en;q=0.8

[2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> Cookie:
SERVERID=djc19

[2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> Authorization:
Bearer sk_test_Gd3JGidPIzfPkMOC8ZGnPEdf

[2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >>
Accept-Encoding: gzip, deflate

[2014-12-11 09:35:55,264] DEBUG - headers http-outgoing-2 >> Origin:
chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Content-Type:
application/x-www-form-urlencoded

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Accept: */*

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Cache-Control:
no-cache

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >>
Transfer-Encoding: chunked

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Host:
api.stripe.com:80

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> Connection:
Keep-Alive

[2014-12-11 09:35:55,265] DEBUG - headers http-outgoing-2 >> User-Agent

Re: [Dev] [Stripe ESB Connector] Getting 400 Bad Request Error

2014-12-10 Thread Vanjikumaran Sivajothy
Hi Keerthika,

I have tried your use-case and notice your request is going with a payload.
However, your back-end is not expecting that.
Therefore you need to drop your message body in the request mediation flow.

In order to drop the message payload you need to perform two tasks in the
wso2 ESB.

Create empty payload using Payload mediator

use the FORCE_POST_PUT_NOBODY
property
to enforce.

Example is given below that demonstrate the use case.

http://ws.apache.org/ns/synapse"; name="strip" context="/strip">
   
  
 
 
   *  
*
*
*
*
*
* *
 
 
* *
 

   https://api.stripe.com/v1/charges/{uri.var.chargeId}/refunds";>

 
 
  
   



On Thu, Dec 11, 2014 at 10:06 AM, Keerthika Mahendralingam <
keerth...@wso2.com> wrote:

> Hi all,
> I am trying to send a post request to https://api.stripe.com/v1/charges/
> 
> {CHARGE_ID}/refunds.
> There are some optional parameters for this request. When I invoked the
> endpoint through esb with the optional parameters I am able to get the
> expected response. But if I invoked the endpoint without the optional
> parameters, an additional body is sent with the request.
> Please find the wire log for the both requests with optional parameters
> and mandatory parameter :
>
> *Wire log for the request with optional parameter:*
>
> [2014-12-11 09:35:54,151] DEBUG - wire >> "POST
> /services/stripe_createANewRefund HTTP/1.1[\r][\n]"
>
> [2014-12-11 09:35:54,151] DEBUG - wire >> "Host:
> keerthikas-macbook-pro.local:8280[\r][\n]"
>
> [2014-12-11 09:35:54,151] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
>
> [2014-12-11 09:35:54,151] DEBUG - wire >> "Content-Length: 61[\r][\n]"
>
> [2014-12-11 09:35:54,151] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"
>
> [2014-12-11 09:35:54,151] DEBUG - wire >> "Origin:
> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm[\r][\n]"
>
> [2014-12-11 09:35:54,151] 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-11 09:35:54,152] DEBUG - wire >> "Content-Type:
> application/json[\r][\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "Accept: */*[\r][\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "Accept-Encoding: gzip,
> deflate[\r][\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "Accept-Language:
> en-US,en;q=0.8[\r][\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "Cookie: SERVERID=djc19[\r][\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "[\r][\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "{[\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >>
> ""chargeId":"ch_158NuEDpl35Wu2ui6atArh0E",[\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "  "amount":"50"[\n]"
>
> [2014-12-11 09:35:54,152] DEBUG - wire >> "}"
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> POST
> /services/stripe_createANewRefund HTTP/1.1
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Host:
> keerthikas-macbook-pro.local:8280
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Connection:
> keep-alive
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >>
> Content-Length: 61
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >>
> Cache-Control: no-cache
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Origin:
> chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> 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
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Content-Type:
> application/json
>
> [2014-12-11 09:35:54,153] DEBUG - headers http-incoming-4 >> Accept: */*
>
> [2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >>
> Accept-Encoding: gzip, deflate
>
> [2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >>
> Accept-Language: en-US,en;q=0.8
>
> [2014-12-11 09:35:54,154] DEBUG - headers http-incoming-4 >> Cookie:
> SERVERID=djc19
>
> [2014-12-11 09:35:54,156] ERROR - SynapseJsonPath #stringValueOf. Error
> evaluating JSON Path <$.refundApplicationFee>. Returning empty result.
> Error>>> invalid path
>
> [2014-12-11 09:35:54,156] ERROR - SynapseJsonPath #stringValueOf. Error
> evaluating JSON Path <$.reason>. Returning empty result. Error>>> invalid
> path
>
> [2014-12-11 09:35:54,157] ERROR - SynapseJsonPath #stringValueOf. Error
> evaluating JSON Path <$.metadata>. Returning empty result. Error>>> invalid
> path
>
> [2014-12-11 09