You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Bh...@objectedge.com on 2012/06/16 03:36:54 UTC

Extract parameters from external call

Hi,
I hope I am able to explain the scenario over here.

I am making a http POST call to an external gateway from one of my ftl 
file. One of the parameters in the call is say redirect_url.

As an example:  Say I have specified one of the request-map in my 
controller.xml as below:
<request-map uri="xyz">
        <security https="true" auth="false"/>
        <event type="java" path="<some java class>" invoke="<some event 
handler>"/>
        <response name="success" type="request" value="<handle success 
from this event>"/>
        <response name="error" type="view" value="<go to error page>"/>
</request-map>

Now I am specifying the value of redirect_url  from my ftl by <@ofbizUrl>
xyz</...@ofbizUrl>

Once this call is processed by the external system, it redirects to a 
specified url in redirect_url and my <some event handler>is being invoked. 
But this external system is responding with some fields using GET method. 
And I am not sure how to capture this fields since I am not able to see 
them in the request variable.

Can some one please help me out on what would be the correct way to make 
such a call to an external gateway? 

Bhargav

Re: Extract parameters from external call

Posted by "bhargav.tri" <Bh...@objectedge.com>.
Thanks for the reply Raj.

I was under the same impression and I was not able to fetch the parameters
using getparameter. 

But I was able to retrieve them using the Utility class (UtilHttp). That was
helpful. 

Thank you,

Bhargav

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Extract-parameters-from-external-call-tp4633625p4633889.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Extract parameters from external call

Posted by Rajbir Saini <ra...@yahoo.com>.
Hello Bhargav,

Processing a request form external system is no different from 
processing a request from your browser. In fact all request coming to 
OFBiz are from an user agent such as browsers, bots or some other clients.

To collect the request parameters (either get or post), you can use 
various HttpServletRequest#getParameter* methods or OFBiz UtilHttp [1] 
utility class.

[1] 
http://ci.apache.org/projects/ofbiz/site/javadocs/org/ofbiz/base/util/UtilHttp.html

Thanks,

Raj

PS: Please do not cross post. OFBiz dev list is to discuss the OFBiz 
development related issues. It is always safe to ask your questions to 
user list and if there is a need someone from dev will ask you to move 
your question to dev list.

On Saturday 16 June 2012 07:06 AM, Bhargav.Trivedi@objectedge.com wrote:
> Hi,
> I hope I am able to explain the scenario over here.
>
> I am making a http POST call to an external gateway from one of my ftl
> file. One of the parameters in the call is say redirect_url.
>
> As an example:  Say I have specified one of the request-map in my
> controller.xml as below:
> <request-map uri="xyz">
>          <security https="true" auth="false"/>
>          <event type="java" path="<some java class>" invoke="<some event
> handler>"/>
>          <response name="success" type="request" value="<handle success
> from this event>"/>
>          <response name="error" type="view" value="<go to error page>"/>
> </request-map>
>
> Now I am specifying the value of redirect_url  from my ftl by<@ofbizUrl>
> xyz</...@ofbizUrl>
>
> Once this call is processed by the external system, it redirects to a
> specified url in redirect_url and my<some event handler>is being invoked.
> But this external system is responding with some fields using GET method.
> And I am not sure how to capture this fields since I am not able to see
> them in the request variable.
>
> Can some one please help me out on what would be the correct way to make
> such a call to an external gateway?
>
> Bhargav