Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Issue with GeoCoding example

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...

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

Issue with GeoCoding example

Hi Shawn,

Please set content type = json, and remove extra request parameters.

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Issue with GeoCoding example

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

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Issue with GeoCoding example

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...

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

Issue with GeoCoding example

Hi Shawn,

What do you see in servercode trace tab?

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Issue with GeoCoding example

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.

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Issue with GeoCoding example

and if I run the same server code from the App Environment i.e. doing a Service Test. It fails twice and then succeeds!

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

Issue with GeoCoding example

Hi Shawn,

Could you please post screenshots of service Test tab and service settings?

vishal kumar
Posts: 0
Joined: Wed Dec 17, 2014 6:06 am

Issue with GeoCoding example

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;

Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Issue with GeoCoding example

Hello!

Please post a screenshots of service Test tab and service settings.

Return to “Issues”