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
  • 1.  Issue with SetResponseCode

    Posted Mon August 27, 2018 10:01 AM

    Hi All,

    I am getting some issue with setResponseCode service. We can use this service to set specific response code for APIs and working fine. But same service when using inside catch block its not working and always setting default response code as 500. Is there any way to overcome this step.

    Please Note: in catch block after using setResponseCode we are using Exit-flow to mark service as failure.

    Thanks
    Baharul Islam


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 2.  RE: Issue with SetResponseCode

    Posted Mon August 27, 2018 10:10 AM

    Use setresponsecode2 recommended.

    The technical error should be masked as 500 Internal Server Error and not throw the actual error.

    If you intend to use other http status code let me know and share the flow snippet probably screen shot should do.


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Issue with SetResponseCode

    Posted Mon August 27, 2018 11:02 AM

    Thanks @Mahesh for your reply.

    However I am using wM version 9.7 and there is no option for setResponseCode2 service.

    I am trying to set different http response code other than 500 from catch block .Please find attached screenshot for ref…

    Thanks
    Baharul Islam

    Service_ScreenShot.PNG


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 4.  RE: Issue with SetResponseCode

    Posted Mon August 27, 2018 11:08 AM

    Try the following: in the try-catch block just set a flag indicating whether an error occurred. Then set the response code as appropriate but do it not within the try-catch block.


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 5.  RE: Issue with SetResponseCode

    Posted Mon August 27, 2018 11:28 AM

    But at the end of the catch block I need to call Exit-flow to mark service status as failure.


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods