parse json file,get maximum value, webservice

Hi community,

Please I need yr help,

i have a web services that return a json file(1), i need to parse that file and get a value that contain the url of another webservice , this second webservice return a json file(2)containes a list of value, i need to get the max value of that file,
how can i do this??
in the attatchement my files,

Regards
Thanks,


json1.png

To parse the json string and convert to IS document use the below service in WmPublic. To get the file content use getFile in the same package.

pub.json:jsonStreamToDocument
pub.json:jsonStringToDocument

Once you have the IData document you can easily continue from there. Please note that the JSON support was added from wM 9.0.

What is your wM version?

Thank you for yr reply,

we use wM 9,7.

when i get the input of my json file how do i get the maximum value of the json 2??

Regards

Its quite simple, convert to json string to IS document. Populate the stringList with all the values and use pub.math:max

Give a try and you must be able to do it. If not copy me the json files to my email id.

thank you for yr reply,
Ok i will give it a try :slight_smile:
Regards,

I have used JSON operations on wM8x using 3rd party library. Don’t remember whose library I did use to assist you the same.

Thanks,

jackson json library is used by wM 9.x and above for JSON support.

There are many available in market namely: Flexjson Library, Json-io Library, Genson Library, JSONiJ Library, Jackson Library …

Thanks,