coldfusion - How to deserialize a very large JSON string -


i'm using below api load data our application

rec registry

as per specification, uses date in yyyy-mm-dd format input. i'm trying deserialize returned json string due large amount of data; i'm getting connection failure error.

is there better way (probably asynchronous) same? tried searching of solutions involve .net.

code far:

<cfhttp url="https://rec-registry.gov.au/rec-registry/app/api/public-register/certificate-actions"         result ="recregistry_json"          method="get" getasbinary="never">     <cfhttpparam name="date" value="#dateformat(dateadd("d",-3, now()),"yyyy-mm-dd")#" type="url"> </cfhttp>  <cfset recjson = deserializejson(recregistry_json.filecontent)>  <cfdump var="#recjson#"> 

edit 1 : based on adam cameron's comment, issue cfdump not able dump huge chunks of data. deserialisation works fine 20 mb worth of data.

in running code locally issue having http request timing out. solve issue added timeout parameter cfhttp tag cfsetting tag top of page.

<cfsetting requesttimeout="9000"> <cfhttp          url="https://rec-registry.gov.au/rec-registry/app/api/public-register/certificate-actions"         result ="recregistry_json"          method="get"          getasbinary="never"          timeout="9000"          file="response.json"         path="#expandpath('/')#" >     <cfhttpparam name="date" value="#dateformat(dateadd("d",-3, now()),"yyyy-mm-dd")#" type="url"> </cfhttp> 

i split functions of downloading file , parsing file did not have wait on download test parsing. note file , path settings on cfhttp tag.

not knowing how intend process data may better off getting smaller chunks such getting 1 day @ time , compiling results after being put local solution.


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -