Hi!
I got a JSON received from my server.
This is the code from reception:
This is Job.GetString value:
(read only map) {
ID = t1;
description = "Questa \U00e8 una descrizione cortissima";
waypoints = (
"(read only map) {\n ID = 1;\n latitudine = \"41.8986108\";\n longitudine = \"12.4768729\";\n \"post_title\" = Pantheon;\n premium = 1;\n}",
"(read only map) {\n ID = 12;\n latitudine = \"41.8913541\";\n longitudine = \"12.4768729\";\n \"post_title\" = Colosseo;\n premium = 0;\n}"
);
},
(......
When arrive to line Dim id As String = root.Get("ID") in line 410, I received this error message:
Anybody know which is the problem?
Thanks
I got a JSON received from my server.
This is the code from reception:
B4X:
Dim parser As JSONParser
parser.Initialize(Job.GetString)
Dim root As Map = parser.NextObject
Dim id As String = root.Get("ID")
Dim description As List = root.Get("description")
Dim waypoints As List = root.Get("waypoints")
For Each colwaypoints As Map In waypoints
Dim idw As String = colwaypoints.Get("ID")
Dim postTitlew As String = colwaypoints.Get("post_title")
Next
This is Job.GetString value:
(read only map) {
ID = t1;
description = "Questa \U00e8 una descrizione cortissima";
waypoints = (
"(read only map) {\n ID = 1;\n latitudine = \"41.8986108\";\n longitudine = \"12.4768729\";\n \"post_title\" = Pantheon;\n premium = 1;\n}",
"(read only map) {\n ID = 12;\n latitudine = \"41.8913541\";\n longitudine = \"12.4768729\";\n \"post_title\" = Colosseo;\n premium = 0;\n}"
);
},
(......
When arrive to line Dim id As String = root.Get("ID") in line 410, I received this error message:
B4X:
Error occurred on line: 410 (Main)
Method not found: Get:, target: (
"(read only map) {\n ID = t1;\n description = \"Questa \\U00e8 una descrizione cortissima\";\n lunghezza = 50000;\n path = \"qiv~F}}ckArAIjBCpCAf@EbACvADAL?JLAfEY~BEhA@J@@ADSjB`@PBVN`@kA|@cCROzA_@|AYRXHKb@h@`@f@^`@AFw@|BU|A\";\n \"post_modified\" = ver5;\n \"post_title\" = \"Tour Lunghissimo\";\n time = 1200;\n waypoints = (\n \"(read only map) {\\n ID = 1;\\n latitudine = \\\"41.8986108\\\";\\n longitudine = \\\"12.4768729\\\";\\n \\\"post_title\\\" = Pantheon;\\n premium = 1;\\n}\",\n \"(read only map) {\\n ID = 12;\\n latitudine = \\\"41.8913541\\\";\\n longitudine = \\\"12.4768729\\\";\\n \\\"post_title\\\" = Colosseo;\\n premium = 0;\\n}\"\n );\n}",
"(read only map) {\n ID = t2;\n description = \"Questa \\U00e8 una descrizione di prova\";\n lunghezza = 20000;\n path = \"cqt~FyrfkAVr@lD~@dDz@~NjC@HLv@Db@cCjFoIlRyBrEmDpG_@bAe@~AUHGL[PeA`@{DfARvB?NDh@?N?V]\\\\eApA]r@b@h@`@f@^`@AFw@|BU|A\";\n \"post_modified\" = ver5;\n \"post_title\" = \"Tour di prova\";\n time = 23500;\n waypoints = (\n \"(read only map) {\\n ID = 132;\\n latitudine = \\\"41.889818\\\";\\n longitudine = \\\"12.490685\\\";\\n \\\"post_title\\\" = \\\"Arco di Costantino\\\";\\n premium = 0;\\n}\",\n \"(read only map) {\\n ID = 12;\\n latitudine = \\\"41.8913541\\\";\\n longitudine = \\\"12.4768729\\\";\\n \\\"post_title\\\" = Colosseo;\\n premium = 0;\\n}\"\n );\n}",
"(read only map) {\n ID = t3;\n description = \"Questa \\U00e8 una descrizione incredibile\";\n lunghezza = 2;\n path = \"cqt~FyrfkAe@sAUNSHk@HYA]GOGWWW]MU_@|Be@SIn@Kb@Ux@uDvHk@`ByA~C{AbD_GjMk@~@c@b@}@fA_@dCe@Ci@L]LYZg@x@Oj@AVBVCNt@jHqARETERYl@UXSJg@J{@DXxAD\\\\?XUl@Oj@QzA?vAuA@cDVGRANAvANNz@Hr@?r@AdDHhFHd@}BBa@@OLAfEY~BEhA@J@@??ADSjB`@PBVN`@kA|@cCROzA_@|AYRXHKb@h@`@f@^`@AFw@|BU|A\";\n \"post_modified\" = ver5;\n \"post_title\" = \"Tour senza compromessi\";\n time = 5000000;\n waypoints = (\n \"(read only map) {\\n ID = 132;\\n latitudine = \\\"41.889818\\\";\\n longitudine = \\\"12.490685\\\";\\n \\\"post_title\\\" = \\\"Arco di Costantino\\\";\\n premium = 0;\\n}\",\n \"(read only map) {\\n ID = 1;\\n latitudine = \\\"41.8986108\\\";\\n longitudine = \\\"12.4768729\\\";\\n \\\"post_title\\\" = Pantheon;\\n premium = 1;\\n}\",\n \"(read only map) {\\n ID = 12;\\n latitudine = \\\"41.8913541\\\";\\n longitudine = \\\"12.4768729\\\";\\n \\\"post_title\\\" = Colosseo;\\n premium = 0;\\n}\"\n );\n}"
)
Stack Trace: (
CoreFoundation __exceptionPreprocess + 182
libobjc.A.dylib objc_exception_throw + 44
CoreFoundation +[NSException raise:format:] + 141
Mapsoo +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 451
Mapsoo -[B4IShell runMethod:] + 515
Mapsoo -[B4IShell raiseEventImpl:method:args::] + 1888
Mapsoo -[B4IShellBI raiseEvent:event:params:] + 1518
Mapsoo +[B4IDebug delegate:::] + 79
Mapsoo -[b4i_main _jobdone:] + 352
CoreFoundation __invoking___ + 29
CoreFoundation -[NSInvocation invoke] + 360
Mapsoo +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 2069
Mapsoo -[B4ICommon CallSubDebug4::::] + 894
Mapsoo -[B4ICommon CallSubDebug2::::] + 350
Mapsoo -[b4i_httpjob _complete::] + 887
Mapsoo -[b4i_httputils2service _completejob::::] + 1585
Mapsoo -[b4i_httputils2service _hc_responsesuccess::] + 938
CoreFoundation __invoking___ + 29
CoreFoundation -[NSInvocation invoke] + 360
Mapsoo +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 2069
Mapsoo -[B4IShell runMethod:] + 515
Mapsoo -[B4IShell raiseEventImpl:method:args::] + 2519
Mapsoo -[B4IShellBI raiseEvent:event:params:] + 1518
Mapsoo __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 273
libdispatch.dylib _dispatch_client_callout + 14
libdispatch.dylib _dispatch_barrier_sync_f_slow_invoke + 54
libdispatch.dylib _dispatch_client_callout + 14
libdispatch.dylib _dispatch_main_queue_callback_4CF + 677
CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
CoreFoundation __CFRunLoopRun + 2256
CoreFoundation CFRunLoopRunSpecific + 443
CoreFoundation CFRunLoopRunInMode + 123
GraphicsServices GSEventRunModal + 192
GraphicsServices GSEventRun + 104
UIKit UIApplicationMain + 1526
Mapsoo main + 138
libdyld.dylib start + 1
)
Anybody know which is the problem?
Thanks