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.


#TechXchangePresenter
 View Only
Expand all | Collapse all

restV2 rest end point response

  • 1.  restV2 rest end point response

    Posted Mon April 04, 2022 03:44 AM

    webMethods 10.5
    Licensed

    Creating restV2 resource rest endpoint

    Hi,

    Does anybody know how to return a boolean response in the response body. I am using pub.flow:setResponse2 to set the response string:

    I want to return something like below:

    Positive response

    {

    "success": true,
    

    }

    Negative response

    {

    "success": false,
    
    "error": "xyz"
    

    }

    Thanks


    #webMethods
    #webМethods-cloud
    #webMethods-io-Integration


  • 2.  RE: restV2 rest end point response

    Posted Mon April 04, 2022 04:32 AM

    Hi @DT30 ,

    Instead of just using the Restv2 resource and invoking the API using the /restv2 directive. Create a Rest API Descriptor and define the signature of the API output as per your requirement. You wouldn’t need to do any additional processing for it. And once you create the Rest API Descriptor, invoke your REST API using the /rad directive.

    Thanks,
    Sree


    #webMethods
    #webMethods-io-Integration
    #webМethods-cloud


  • 3.  RE: restV2 rest end point response

    Posted Mon April 04, 2022 04:44 AM

    Should be something like this

    true case
    image

    false case
    image


    #webMethods
    #webMethods-io-Integration
    #webМethods-cloud