Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Doing POST to external server
Doing POST to external server [message #641873] Mon, 29 November 2010 02:18 Go to next message
Gustavo is currently offline GustavoFriend
Messages: 12
Registered: July 2009
Junior Member
Hi there

I'm trying to develop a Button that works like the Amazon FPS payment
button which does a POST action when clicked.
I have tried the following:
- Use PrintWriter from RWT.getResponse().getWriter(). When I use this
and try to print the <form> tag (and its hidden fields) the browser
shows an InvalidStateException: WRITER message.
- I also created an Equinox Servlet so I perform a redir and delegate
<form> tag creation (and its hidden fields) also using PrintWriter
object, but the browser shows "Session expired".

Now I'm trying to create a custom widget that uses an
qx.io.remote.Request instance and override _sendChanges Button's method
(my class inherits from org.eclipse.rwt.widgets.Button):

members : {

_sendChanges : function() {
this.info("debugging in qooxdoo!!!!!!!!!!");

req = new
qx.io.remote.Request(" https://authorize.payments-sandbox.amazon.com/pba/paypipelin e",
"POST", "text/html");
req.setParameter("returnUrl","");
req.setParameter("ipnUrl","");
req.setParameter("processImmediate","1");
req.setParameter("accessKey","AKIAI40KDLFJYS5P4KGQ");
req.setParameter("signatureMethod","HmacSHA256");
req.setParameter("fixedMarketplaceFee","0.01");
req.setParameter("referenceId","test-reference123");
req.setParameter("cobrandingStyle","logo");
req.setParameter("recipientEmail","test@amazon.com");
req.setParameter("immediateReturn","0");
req.setParameter("amount","USD 1.1");
req.setParameter("description","description");
req.setParameter("abandonUrl","");
req.setParameter("variableMarketplaceFee","4");
req.setParameter("signatureVersion","2");

req.setParameter("signature","lpILGczDhpecyQAtr8BjOji4ex7CVh7+26bwwKiuZT4= ");
req.setCrossDomain(true);
req.send();

}

}

Until now when I click on the Button instance I get nothing, not even
the logger line. Can anybody help me please?

Thanks
Gustavo
Re: Doing POST to external server [message #642017 is a reply to message #641873] Mon, 29 November 2010 13:27 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Gustavo,
are you running your application in "debug" mode? Please check your
launch configuration settings - "Client-side library variant" and
"Client-side log level".
Best,
Ivan

On 29.11.2010 4:18 AM, Gustavo wrote:
> Hi there
>
> I'm trying to develop a Button that works like the Amazon FPS payment
> button which does a POST action when clicked.
> I have tried the following:
> - Use PrintWriter from RWT.getResponse().getWriter(). When I use this
> and try to print the <form> tag (and its hidden fields) the browser
> shows an InvalidStateException: WRITER message.
> - I also created an Equinox Servlet so I perform a redir and delegate
> <form> tag creation (and its hidden fields) also using PrintWriter
> object, but the browser shows "Session expired".
>
> Now I'm trying to create a custom widget that uses an
> qx.io.remote.Request instance and override _sendChanges Button's
> method (my class inherits from org.eclipse.rwt.widgets.Button):
>
> members : {
>
> _sendChanges : function() {
> this.info("debugging in qooxdoo!!!!!!!!!!");
>
> req = new
> qx.io.remote.Request(" https://authorize.payments-sandbox.amazon.com/pba/paypipelin e",
> "POST", "text/html");
> req.setParameter("returnUrl","");
> req.setParameter("ipnUrl","");
> req.setParameter("processImmediate","1");
> req.setParameter("accessKey","AKIAI40KDLFJYS5P4KGQ");
> req.setParameter("signatureMethod","HmacSHA256");
> req.setParameter("fixedMarketplaceFee","0.01");
> req.setParameter("referenceId","test-reference123");
> req.setParameter("cobrandingStyle","logo");
> req.setParameter("recipientEmail","test@amazon.com");
> req.setParameter("immediateReturn","0");
> req.setParameter("amount","USD 1.1");
> req.setParameter("description","description");
> req.setParameter("abandonUrl","");
> req.setParameter("variableMarketplaceFee","4");
> req.setParameter("signatureVersion","2");
>
> req.setParameter("signature","lpILGczDhpecyQAtr8BjOji4ex7CVh7+26bwwKiuZT4= ");
> req.setCrossDomain(true);
> req.send();
>
> }
>
> }
>
> Until now when I click on the Button instance I get nothing, not even
> the logger line. Can anybody help me please?
>
> Thanks
> Gustavo
Re: Doing POST to external server [message #642128 is a reply to message #642017] Tue, 30 November 2010 00:12 Go to previous messageGo to next message
Gustavo  is currently offline Gustavo Friend
Messages: 4
Registered: November 2010
Junior Member
Hi Ivan

Yes, I'm running my application in debug mode and also set Client-side
log level to "All". I haven't found "Client-side library variant"
though, I'm using Eclipse Helios and RAP 1.3.
When the application starts it shows the Qooxdoo logging window, but
when I click on my button the log window shows nothing.

Best Regards.
Gustavo
On 11/29/2010 11:27 AM, Ivan Furnadjiev wrote:
> Hi Gustavo,
> are you running your application in "debug" mode? Please check your
> launch configuration settings - "Client-side library variant" and
> "Client-side log level".
> Best,
> Ivan
>
> On 29.11.2010 4:18 AM, Gustavo wrote:
>> Hi there
>>
>> I'm trying to develop a Button that works like the Amazon FPS payment
>> button which does a POST action when clicked.
>> I have tried the following:
>> - Use PrintWriter from RWT.getResponse().getWriter(). When I use this
>> and try to print the <form> tag (and its hidden fields) the browser
>> shows an InvalidStateException: WRITER message.
>> - I also created an Equinox Servlet so I perform a redir and delegate
>> <form> tag creation (and its hidden fields) also using PrintWriter
>> object, but the browser shows "Session expired".
>>
>> Now I'm trying to create a custom widget that uses an
>> qx.io.remote.Request instance and override _sendChanges Button's
>> method (my class inherits from org.eclipse.rwt.widgets.Button):
>>
>> members : {
>>
>> _sendChanges : function() {
>> this.info("debugging in qooxdoo!!!!!!!!!!");
>>
>> req = new
>> qx.io.remote.Request(" https://authorize.payments-sandbox.amazon.com/pba/paypipelin e",
>> "POST", "text/html");
>> req.setParameter("returnUrl","");
>> req.setParameter("ipnUrl","");
>> req.setParameter("processImmediate","1");
>> req.setParameter("accessKey","AKIAI40KDLFJYS5P4KGQ");
>> req.setParameter("signatureMethod","HmacSHA256");
>> req.setParameter("fixedMarketplaceFee","0.01");
>> req.setParameter("referenceId","test-reference123");
>> req.setParameter("cobrandingStyle","logo");
>> req.setParameter("recipientEmail","test@amazon.com");
>> req.setParameter("immediateReturn","0");
>> req.setParameter("amount","USD 1.1");
>> req.setParameter("description","description");
>> req.setParameter("abandonUrl","");
>> req.setParameter("variableMarketplaceFee","4");
>> req.setParameter("signatureVersion","2");
>> req.setParameter("signature","lpILGczDhpecyQAtr8BjOji4ex7CVh7+26bwwKiuZT4= ");
>>
>> req.setCrossDomain(true);
>> req.send();
>>
>> }
>>
>> }
>>
>> Until now when I click on the Button instance I get nothing, not even
>> the logger line. Can anybody help me please?
>>
>> Thanks
>> Gustavo
Re: Doing POST to external server [message #642383 is a reply to message #642128] Wed, 01 December 2010 07:23 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Gustavo,
I don't see any reason why the overrided _sendChanges function is not
called. Maybe you create an instance of "org.eclipse.rwt.widgets.Button"
in your custom widget LCA instead of your custom widget javascript
class?! Without a complete code of your custom button I can't help you much.
Best,
Ivan

On 30.11.2010 2:12 AM, Gustavo wrote:
> Hi Ivan
>
> Yes, I'm running my application in debug mode and also set Client-side
> log level to "All". I haven't found "Client-side library variant"
> though, I'm using Eclipse Helios and RAP 1.3.
> When the application starts it shows the Qooxdoo logging window, but
> when I click on my button the log window shows nothing.
>
> Best Regards.
> Gustavo
> On 11/29/2010 11:27 AM, Ivan Furnadjiev wrote:
>> Hi Gustavo,
>> are you running your application in "debug" mode? Please check your
>> launch configuration settings - "Client-side library variant" and
>> "Client-side log level".
>> Best,
>> Ivan
>>
>> On 29.11.2010 4:18 AM, Gustavo wrote:
>>> Hi there
>>>
>>> I'm trying to develop a Button that works like the Amazon FPS payment
>>> button which does a POST action when clicked.
>>> I have tried the following:
>>> - Use PrintWriter from RWT.getResponse().getWriter(). When I use this
>>> and try to print the <form> tag (and its hidden fields) the browser
>>> shows an InvalidStateException: WRITER message.
>>> - I also created an Equinox Servlet so I perform a redir and delegate
>>> <form> tag creation (and its hidden fields) also using PrintWriter
>>> object, but the browser shows "Session expired".
>>>
>>> Now I'm trying to create a custom widget that uses an
>>> qx.io.remote.Request instance and override _sendChanges Button's
>>> method (my class inherits from org.eclipse.rwt.widgets.Button):
>>>
>>> members : {
>>>
>>> _sendChanges : function() {
>>> this.info("debugging in qooxdoo!!!!!!!!!!");
>>>
>>> req = new
>>> qx.io.remote.Request(" https://authorize.payments-sandbox.amazon.com/pba/paypipelin e",
>>>
>>> "POST", "text/html");
>>> req.setParameter("returnUrl","");
>>> req.setParameter("ipnUrl","");
>>> req.setParameter("processImmediate","1");
>>> req.setParameter("accessKey","AKIAI40KDLFJYS5P4KGQ");
>>> req.setParameter("signatureMethod","HmacSHA256");
>>> req.setParameter("fixedMarketplaceFee","0.01");
>>> req.setParameter("referenceId","test-reference123");
>>> req.setParameter("cobrandingStyle","logo");
>>> req.setParameter("recipientEmail","test@amazon.com");
>>> req.setParameter("immediateReturn","0");
>>> req.setParameter("amount","USD 1.1");
>>> req.setParameter("description","description");
>>> req.setParameter("abandonUrl","");
>>> req.setParameter("variableMarketplaceFee","4");
>>> req.setParameter("signatureVersion","2");
>>> req.setParameter("signature","lpILGczDhpecyQAtr8BjOji4ex7CVh7+26bwwKiuZT4= ");
>>>
>>>
>>> req.setCrossDomain(true);
>>> req.send();
>>>
>>> }
>>>
>>> }
>>>
>>> Until now when I click on the Button instance I get nothing, not even
>>> the logger line. Can anybody help me please?
>>>
>>> Thanks
>>> Gustavo
>
Re: Doing POST to external server [message #642610 is a reply to message #642383] Thu, 02 December 2010 00:43 Go to previous message
Gustavo  is currently offline Gustavo Friend
Messages: 4
Registered: November 2010
Junior Member
Hi Ivan

Your hint about the LCA class made me see I wasn't using the correct
pattern required by RAP. Now my widget is at least showing the log line
but still not getting the effect I want: do a POST so I show the Amazon
FPS front-end. I have some ideas, I will let you know if it works!!

Thanks
Gustavo

On 12/01/2010 05:23 AM, Ivan Furnadjiev wrote:
> Hi Gustavo,
> I don't see any reason why the overrided _sendChanges function is not
> called. Maybe you create an instance of "org.eclipse.rwt.widgets.Button"
> in your custom widget LCA instead of your custom widget javascript
> class?! Without a complete code of your custom button I can't help you
> much.
> Best,
> Ivan
>
> On 30.11.2010 2:12 AM, Gustavo wrote:
>> Hi Ivan
>>
>> Yes, I'm running my application in debug mode and also set Client-side
>> log level to "All". I haven't found "Client-side library variant"
>> though, I'm using Eclipse Helios and RAP 1.3.
>> When the application starts it shows the Qooxdoo logging window, but
>> when I click on my button the log window shows nothing.
>>
>> Best Regards.
>> Gustavo
>> On 11/29/2010 11:27 AM, Ivan Furnadjiev wrote:
>>> Hi Gustavo,
>>> are you running your application in "debug" mode? Please check your
>>> launch configuration settings - "Client-side library variant" and
>>> "Client-side log level".
>>> Best,
>>> Ivan
>>>
>>> On 29.11.2010 4:18 AM, Gustavo wrote:
>>>> Hi there
>>>>
>>>> I'm trying to develop a Button that works like the Amazon FPS payment
>>>> button which does a POST action when clicked.
>>>> I have tried the following:
>>>> - Use PrintWriter from RWT.getResponse().getWriter(). When I use this
>>>> and try to print the <form> tag (and its hidden fields) the browser
>>>> shows an InvalidStateException: WRITER message.
>>>> - I also created an Equinox Servlet so I perform a redir and delegate
>>>> <form> tag creation (and its hidden fields) also using PrintWriter
>>>> object, but the browser shows "Session expired".
>>>>
>>>> Now I'm trying to create a custom widget that uses an
>>>> qx.io.remote.Request instance and override _sendChanges Button's
>>>> method (my class inherits from org.eclipse.rwt.widgets.Button):
>>>>
>>>> members : {
>>>>
>>>> _sendChanges : function() {
>>>> this.info("debugging in qooxdoo!!!!!!!!!!");
>>>>
>>>> req = new
>>>> qx.io.remote.Request(" https://authorize.payments-sandbox.amazon.com/pba/paypipelin e",
>>>>
>>>> "POST", "text/html");
>>>> req.setParameter("returnUrl","");
>>>> req.setParameter("ipnUrl","");
>>>> req.setParameter("processImmediate","1");
>>>> req.setParameter("accessKey","AKIAI40KDLFJYS5P4KGQ");
>>>> req.setParameter("signatureMethod","HmacSHA256");
>>>> req.setParameter("fixedMarketplaceFee","0.01");
>>>> req.setParameter("referenceId","test-reference123");
>>>> req.setParameter("cobrandingStyle","logo");
>>>> req.setParameter("recipientEmail","test@amazon.com");
>>>> req.setParameter("immediateReturn","0");
>>>> req.setParameter("amount","USD 1.1");
>>>> req.setParameter("description","description");
>>>> req.setParameter("abandonUrl","");
>>>> req.setParameter("variableMarketplaceFee","4");
>>>> req.setParameter("signatureVersion","2");
>>>> req.setParameter("signature","lpILGczDhpecyQAtr8BjOji4ex7CVh7+26bwwKiuZT4= ");
>>>>
>>>>
>>>> req.setCrossDomain(true);
>>>> req.send();
>>>>
>>>> }
>>>>
>>>> }
>>>>
>>>> Until now when I click on the Button instance I get nothing, not even
>>>> the logger line. Can anybody help me please?
>>>>
>>>> Thanks
>>>> Gustavo
>>
Previous Topic:TinyMCE can't working with RAP1.4M3
Next Topic:Browser.setUrl(String url, String postData, String[] headers)
Goto Forum:
  


Current Time: Thu Apr 18 23:33:23 GMT 2024

Powered by FUDForum. Page generated in 0.02053 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top