Hello,
I am looking for a solution on how ro read the json response i get from the google maps api.
I want to send address information to the api, and based on the response i get in the status field, then I know if the address is valid or not.
this is a response I recieve from a non valid address:
{
"geocoded_waypoints" : [
{
"geocoder_status" : "OK",
"place_id" : "Ei5HdWlkbyBHZXplbGxlc3RyYWF0IDU3LCA4NTUwIFp3ZXZlZ2VtLCBCZWxnacOr",
"types" : [ "street_address" ]
},
{
"geocoder_status" : "ZERO_RESULTS"
}
],
"routes" : [],
"status" : "NOT_FOUND"
}
this is the URL I have to process:
https://maps.googleapis.com/maps/api/directions/json?origin=_address_
I have tried using the json parser from here:
http://www.dynamics.is/?p=2303
but I can not get it to work..
Could any1 help me in the right direction?
thank you
Answers
I have created a DLL , I've placed the dll in the add-in folder and i've registered the dll in controll add-in in navision, and restarted the navision service.
but when I run my codeunit, I am still getting the 'can not load an instance of the following .NET framework ...' error.
Am I missing a step somewhere?
Couple of things:
I don't know which NAV version you are using but at least in NAV 2016 there is a standard codeunit 1237 Get Json Structure which is using "standard" Newtonsoft JsonConvert class. Maybe you can use that, or copy patterns from the CU, so no need to build own dll?
I just also created own dll in my recent project, it get working without registering it, just putting it to Program Files\Microsoft Dynamics NAV\90\Service\Add-ins\ folder. Actually, what is the reason that those dll's must be registeded to the add-in table in NAV?
So have you checked that you have placed your dll in right folder and set the run on client property according to that?
Sample:
//maps.googleapis.com/maps/api/geocode/xml?
now I can read my status result, wich is in the rootobject level, but when I try to read something from a 2nd level (rootobject/geocoder_status for example), all I get is blanks.. so this is my next challenge