Skip to main content
Question

HTTP Json Parsing

  • October 4, 2019
  • 3 replies
  • 16 views

sunsilk11
Contributor
Forum|alt.badge.img+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?

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • October 4, 2019

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.

sunsilk11
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • October 10, 2019

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?


jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • October 10, 2019

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.