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

Webmethods io newbie - How to force a specific response on an http interface

  • 1.  Webmethods io newbie - How to force a specific response on an http interface

    Posted Mon July 17, 2023 03:46 AM

    Hi !
    I’m working with flowservices in webMethods and I have this client i have to send responses to. Obviously the response is changing in function of if it works or not and i need to force a specific response into my client (for example an object if the call works or a string or another object if it doesn’t).

    The problem i have is that with webMethods the only way i know to have only one thing in return is to drop the variables i don’t want but i may need them in some cases. I tried to drop variables into an if / else statement but that doesn’t work.

    For exemple if i’m in an error case, i only want the error to show in postman and not the rest of the response (other response of previous flowservice that are called before for example). But if i don’t drop everything else in webMethods, I have them all in postman.

    Anyone with a tips on it ?

    Thanks


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Webmethods io newbie - How to force a specific response on an http interface

    Posted Mon July 17, 2023 03:59 AM

    @kassandra.aubin

    It’s good keep only necessary variables at each steps . And frame a error and success document signature framework . In case of error kindly refer pub.flow:getLastError extract lastError/error and pass to your [ response String ] to pub.flow:setResponse2 and in case of success case set response String of pub.flow:setResponse2 - to set the response to client

    Note : Its necessary to drop the variable which should not be sent to client


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Webmethods io newbie - How to force a specific response on an http interface

    Posted Mon July 17, 2023 07:06 AM

    Thanks for your answer ! :smiling_face:
    I forgot to precise that it was on webmethods.io and not webMethods. But that’s ok we found another way to do it.
    Thanks again sir !


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB