Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Dynamic urls in services

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Dynamic urls in services

Hi Kevin,

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

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Dynamic urls in services

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({})?

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Dynamic urls in services

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

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Dynamic urls in services

Oleg,
That works!
Thanks for your help!

Return to “Issues”