Page 1 of 1

Dynamic urls in services

Posted: Thu Nov 07, 2013 4:59 pm
by Kevin Preston

I am trying to dynamically change request parameters as shown in this link
https://getsatisfaction.com/apperyio/...
I change the url with the appropriate parameters and call
service_name.execute({"url":"http://www.xxxx/my.svc/ud?p=test&ci=test});
This does not work when you test in the browser either using the appery proxy (in settings) or not but does work on the mobile when the proxy is off. This makes debugging very slow as you have to build and install before you can see what is happening.
The service works OK (using the proxy) if I don't change the url but just use the url and parameters in 'settings'. How do I use the proxy with dynamic urls to help with debugging?


Dynamic urls in services

Posted: Thu Nov 07, 2013 5:47 pm
by Kateryna Grynko

Hi Kevin,

Did you try specifying URL in Request parameter as described here? http://docs.appery.io/documentation/r...


Dynamic urls in services

Posted: Fri Nov 08, 2013 9:53 am
by Kevin Preston

Katya,
Could you clarify how to do this please?
In the service settings I have :
URL= http://www.xxxxxxxx/rmms.svc/{params}

and I have set params as a request parameter.

In a button click event I have:
restservice1.execute({"params":"rmmgt?ci=test&p=start"});

When I invoke the service I get :
Request URL:https://appery.io/app/rest/tunnel
Request Method:GET
Status Code:404 Not Found
Request Headersview source
Accept:application/json, text/javascript, /; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
appery-key:1383903549895
appery-proxy-url:http://www.xxxxxxxxl/rmms.svc/
appery-rest:2741264
Connection:keep-alive
Host:appery.io
Origin:http://appery.io

So it looks like the params aren't being passed, presumably there is something wrong with the service.execute({})?


Dynamic urls in services

Posted: Fri Nov 08, 2013 10:14 am
by Oleg Danchenkov

Hi, Kevin.
Try this
precoderestservice1.execute({"data": {"params":"rmmgt?ci=test&p=start"}}); /code/pre


Dynamic urls in services

Posted: Fri Nov 08, 2013 10:28 am
by Kevin Preston

Oleg,
That works!
Thanks for your help!