IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  parse json file,get maximum value, webservice

    Posted 02/11/16 10:37 AM

    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


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: parse json file,get maximum value, webservice

    Posted 02/11/16 10:44 AM

    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?


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: parse json file,get maximum value, webservice

    Posted 02/11/16 10:47 AM

    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


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: parse json file,get maximum value, webservice

    Posted 02/11/16 11:00 AM

    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.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: parse json file,get maximum value, webservice

    Posted 02/11/16 11:07 AM

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


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: parse json file,get maximum value, webservice

    Posted 02/14/16 02:37 AM

    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,


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: parse json file,get maximum value, webservice

    Posted 02/14/16 01:05 PM

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


    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: parse json file,get maximum value, webservice

    Posted 02/15/16 02:42 AM

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

    Thanks,


    #webMethods
    #Integration-Server-and-ESB