Page 1 of 2
Issue with GeoCoding example
Posted: Tue Jul 01, 2014 7:09 pm
by Shawn
I'm trying to use this example ...
http://devcenter.appery.io/tutorials/...
I've reused the code to create a Server side script and setup the parameters
and when testing get the following error
Script GeoCoding: TypeError: Cannot read property 'latitude' of null ( @ 7 : 31 ) - var latitude = request.object().latitude;
It fails on line 7 of the example
var latitude = request.object().latitude;
I've set 'latitude' in the request parameters and set it with a value 51.5723081 for London.
Here's a link to the server code if needed
https://appery.io/servercode/470f8a03...
Issue with GeoCoding example
Posted: Tue Jul 01, 2014 7:55 pm
by Kateryna Grynko
Hi Shawn,
Please set content type = json, and remove extra request parameters.
Issue with GeoCoding example
Posted: Tue Jul 01, 2014 8:29 pm
by Shawn
Hi Katya, ok I think I see the problem under Request 'Content-Type' should be 'JSON' as you mentioned and also 'header' option ticked ... that seemed to have worked ! Thx
Issue with GeoCoding example
Posted: Tue Jul 01, 2014 9:19 pm
by Shawn
ok this is very strange ...
if I set the radius to 100
latitude to 51.5723317
longitude to -0.3453575
and test ... it works and then I immediately click test again it fails with an error!
{
"status":"400 Bad Request",
"url":"https://api.appery.io/rest/1/code/470...",
"response":"An error occured"
}
how is that possible ?
http://appery.io/app/project/6cdb9ddb...
Issue with GeoCoding example
Posted: Wed Jul 02, 2014 6:15 pm
by Kateryna Grynko
Hi Shawn,
What do you see in servercode trace tab?
Issue with GeoCoding example
Posted: Wed Jul 02, 2014 6:45 pm
by Shawn
I see this error ...
Script GeoCoding: TypeError: Cannot read property 'latitude' of null ( @ 7 : 31 ) - var latitude = request.object().latitude;
which is the same error I raised in my first request.
Issue with GeoCoding example
Posted: Wed Jul 02, 2014 6:50 pm
by Shawn
and if I run the same server code from the App Environment i.e. doing a Service Test. It fails twice and then succeeds!
Issue with GeoCoding example
Posted: Wed Jul 02, 2014 8:59 pm
by Kateryna Grynko
Hi Shawn,
Could you please post screenshots of service Test tab and service settings?
Issue with GeoCoding example
Posted: Thu Dec 18, 2014 12:11 pm
by vishal kumar
Hi ,
I have the same error . Please Suggest how to resolve it.
Script GeoCoding: TypeError: Cannot read property 'latitude' of null ( @ 7 : 31 ) - var latitude = request.object().latitude;
Issue with GeoCoding example
Posted: Thu Dec 18, 2014 12:55 pm
by Maryna Brodina
Hello!
Please post a screenshots of service Test tab and service settings.