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

Using TN as request/Reply, and get response back to calling flow.

  • 1.  Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 02:48 PM

    Hi,

    Please help on how to Use TN for a Request Reply mechanism.

    I have Flow Service A, that needs to submit a document to TN, which triggers a Processing Rule to invoke service B.

    I want the output/Response parameter “Response” from service B, back to the flow of serviceA.

    Service A
    Get Xml
    Extracts EDI doc
    Submits to TN using wm.tn:receive
    Map Step, waiting for response…

    Service B
    Extracts EDI
    Maps to Web Service.
    Gets response from Ws
    Maps response to EDI
    converts to XML String “Response”

    I need this “Response” in service A. Please help.


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 2.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 03:20 PM

    You can try using java service doInvoke or something sort of to get the entire pipeline output response signature from service B to A instead of having processing rule based invoke:

    HTH,
    RMG


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 3.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 03:41 PM

    Thanks,

    But I have to Us TN, to identify the EDI document. As the XML can contain different type of EDI’s.

    So once submitted to TN, TN will identify the Processing service, and will identify the processing service. I just need to bring the response of processing service back to Service A(Submitter)


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 4.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 03:57 PM

    In that case create TN handler service and it will receive EDIdata and explicitly do invokes service B using Java based Invoke method and extract the pipeline output to A…so just make sure the Invoke returns the pipeline values as expected.

    HTH,
    RMG


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 5.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 04:02 PM

    As long as the processing rule is synchronous, whatever is placed in the pipeline by Service B will be available to Service A after the call to wm.tn:receive returns. You don’t need to call Service B directly and you definitely do not need to use Java.


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 6.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 04:16 PM

    Thanks Reamon

    I tried that. But it is not bringing the output of service B to Service A

    1. Set processing rule to execute service synchronous.

    2. Then I tried setting TN_clearTNObjects = false.

    Either did not bring back any output of Service B to A… is there any other settings needs to be done?

    Do I need to do anything at the end of service B (Processing Service) to make the variables available to service A.


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 04:22 PM

    I believe JS invoke does help returns the pipeline and I don’t think synchronous will help get the entire/expected pipeline returns to B…

    There is nothing wrong to test using java invoke I would say:

    Just my thoughts!

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 8.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 04:51 PM

    This will not work her, as this is EDI processing, so Service A publist to TN can be routed to Service B or C or D, depending on EDI DocType…

    But all of them will have same output signature, to send response back…

    Eg: EDI270 → service B
    EDI276 → service C…etc…


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 9.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 05:47 PM

    It’s been a number of years but I have indeed done this in the past. In Developer you won’t see the vars. At run-time, they should be there. Have you done a save pipeline to see?


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 05:58 PM

    My suggestion is also uses TN only but only difference is instead of calling service B directly it calls generic handler handler service (say processInbound) that does the actual do Invokes svc B,C etc…based on the transaction X12/type/version from your table.

    Sorry If this design still does’t work for you:

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 11.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 06:15 PM

    Same issue will be here to, as the handler service (say processInbound) will bring the response back from service B, C, D… in pipeline, but how to bring that response back to service A…

    My Scenerio is

    Client submits edi in XML → ServiceA → submits EDI to TN → Processing rule invokes Service B,C, D to get response back from backend system.

    how do I get the response back to Service A , so I can send it back to Client? on a sync call.


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 12.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 06:22 PM

    Have you done a savePipeline to see if the vars are in the pipeline after the receive call?


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 13.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 07:03 PM

    Even though its a synchronous call how would you get response back like similar to http and setResponse calls:

    TN isn’t request/reply for processing data we sent internally in your example service A (submitted EDI to TN and not exactly received from externally via http to receive/handler service) and you sent synchronous response back:

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 14.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Tue November 08, 2011 07:10 PM

    yes, I tried doing savePipeline, but var are not being returned to the Caller service by TN.


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 15.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Wed November 09, 2011 01:59 PM

    Hello Reamon,

    With your solution I went a step further. but still issue.

    When I submit the data to TN (wm.tn:receive) as a node, it does return the outputs back.

    But when I submit the data to TN as a stream, it does not return the outputs back…

    As I have to submit EDI, I have to submit is as stream instead of Node.

    Any suggessions on how to handle this?


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 16.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Wed November 09, 2011 05:20 PM

    It shouldn’t be submit as stream to tn:receive…it must be node only…except if you are using flat file routing (routeFlatfile call work with streams)

    HTH,
    RMG


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 17.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Wed November 09, 2011 05:38 PM

    Make sure all the EDI-related rules are sync.

    But it may be that for EDI this isn’t possible/advisable (my earlier work with returning pipeline vars wasn’t for EDI). The splitting of the envelopes may kick off threads. You may be stuck. If threads are used and you cannot control them via the rules, then you won’t be able to pass a synchronous response back.


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 18.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Thu September 05, 2019 03:13 PM

    Hi,

    Has anybody found the way how to do this? I tried wm.tn:receive I could not get response from the processing rule service. Can you please help?

    Thanks,


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 19.  RE: Using TN as request/Reply, and get response back to calling flow.

    Posted Thu September 05, 2019 05:20 PM

    Not sure if this will fit your scenario, but we have a similar requirement in which B2B Service A processes an EDI document in TN, publishing a canonical, which is subscribed and processed by a service on the EAI server (Service B). At the conclusion of Service B, a canonical called TNDocumentStatus is published. B2B server subscribes to TNDocumentStatus and updates the User Status in the related TN EDI document with the status value from Service B.

    If you are not using pub/sub, perhaps you could create a custom flat file or XML document type in TN (called something like TN Document Status that contains the Response from Service B and values necessary to identify the original EDI document in TN) and Service B could generate TN documents of that type. The processing rule for that document type could invoke a service that updates the User Status (or custom doc attributes) for the related EDI document.

    -Mary


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB