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
Expand all | Collapse all

Correct flow service input for JSON?

  • 1.  Correct flow service input for JSON?

    Posted 05/02/17 07:31 PM

    Hello,

    I have combed the forums but cannot find an answer. I am using Postman to POST to a flow service that was created as a REST resource. If I set the type as “text/plain” in Postman I can set the input to the flow service as an Object named “contentStream”. I can then use pub.json:jsonStreamToDocument to convert to a document and do what is needed from there.

    If in postman I set the type as “application/json” this no longer works and I see a “jsonStream missing” error most likely from the stream coming in as empty when mapped to the input of the StreamToDocument service.

    I have found a few tutorials but none cover what type of input I am supposed to be setting for the flow service. I even found this guide here[url]How to create a REST service in webMethods Integration Server - SOA rocks! that said ““IS automatically unwraps the JSON payload and converts it to IS documents”.” To me this sounds like a Document should be the input but that doesn’t work either.

    Can anyone share what the proper input / first steps are for a flow service to accept the POSTing of application/json content?

    Thanks!


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Correct flow service input for JSON?



  • 3.  RE: Correct flow service input for JSON?

    Posted 05/03/17 06:51 PM

    Thank you, this is exactly what I was looking for! Got mine working.


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Correct flow service input for JSON?

    Posted 05/04/17 05:33 AM


  • 5.  RE: Correct flow service input for JSON?

    Posted 05/04/17 07:02 PM

    I got most of this to work however I am unsure how to accept an array in the JSON as input.

    For example if you had:

    {
    “cars”: {
    “Nissan”: [
    {“model”:“Sentra”, “doors”:4},
    {“model”:“Maxima”, “doors”:4}
    ],
    “Ford”: [
    {“model”:“Taurus”, “doors”:4},
    {“model”:“Escort”, “doors”:4}
    ]
    }
    }

    I have tried setting the equivalent of “Nissan” on my end to “Document List” but it does not seem to come into the service at all. Thank you in advance


    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Correct flow service input for JSON?

    Posted 05/05/17 02:15 AM

    Stange. I just copy pasted your request input, and I can see document list coming on IS
    Postman_Request.PNG
    IS_Pipeline.PNG


    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Correct flow service input for JSON?

    Posted 05/23/17 07:51 PM

    I think I found my problem. I am saving the pipeline and then manually loading it / restoring later to run. The pipeline file will load however elements under the Document list type do not. This is why I was thinking they were not coming into the service in the first place. Seems to be an issue with webMethods not properly restoring a list from pipeline.


    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: Correct flow service input for JSON?

    Posted 05/23/19 01:31 AM

    If we don’t know JSON input structure(Dynamic input) then how can i capture JSON data in webMethods service. as i remember we can take JSON input as object then we can convert into document.
    could you please share steps if you have idea?


    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: Correct flow service input for JSON?

    Posted 05/23/19 08:35 AM

    You need not necessarily declare a structural document as input in your service. Integration Server Content Handler automatically sends you the document as per your dynamic JSON into your service.


    #webMethods
    #Integration-Server-and-ESB


  • 10.  RE: Correct flow service input for JSON?

    Posted 04/02/20 08:19 AM

    Is it not work around for this, do I need to know the structure of the json payload?

    I like to have a generic rest-service that can receive a json payload and publish to UM without knowing the payload structure.


    #Integration-Server-and-ESB
    #webMethods