Question

HTTP Json Parsing

  • 4 October 2019
  • 3 replies
  • 4 views

Badge +6

Hi I have a table with about 5 million rows. I need to populate an attribute in the table using an external

HTTP service, which expects a json parameter built using attributes from same table. The response is also in json format

Expected input json:

[

{"id":0,"x":320000,"y":290000}

{"id":1,"x":345000,"y":310000}

{"id":2,"x":410000,"y":300000}

]

 

Expected Output:

[

{"id":0,"z":45.0009}

{"id":1,"x":12.236633}

{"id":2,"z":24.9987}

]

Any suggestion what would be the best way to do this using FME?

 


3 replies

Badge +22

You can use a JSONTemplater to create the input json as an attribute and then use the an httpCaller and post the JSON to the service. Use a JSONFragmenter on the response body to get the individual features.

 

 

99817-jsonparsing.fmw

 

 

In a production environment I would put in various validations and error catching.
Badge +6

You can use a JSONTemplater to create the input json as an attribute and then use the an httpCaller and post the JSON to the service. Use a JSONFragmenter on the response body to get the individual features.

 

 

99817-jsonparsing.fmw

 

 

In a production environment I would put in various validations and error catching.

Thanks for the response.

Unfortunately this gives me "The server did not generate valid JSON".

The json request is created correctly, as I can use it via SOAPUI

 

Any ideas?

Badge +22

Thanks for the response.

Unfortunately this gives me "The server did not generate valid JSON".

The json request is created correctly, as I can use it via SOAPUI

 

Any ideas?

Not without seeing the workspace and log unfortunately.

Reply