Skip to Content
avatar image
Former Member

Mirroring synchronous response in SAP PI

Hi Folks,

I am working on a synchronous scenario where sender is SOAP. I wish to have a dummy receiver channel which does nothing and returns the payload as it is - basically it mirrors out the payload. What can be the best way to do so ?

I am doing something at the sender channel while returning the SOAP response back, so receiver channel is working as a dummy here.

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    Hi All,

    Sorry for replying late on this. But I found a workaround for this problem. I used a custom adapter module (similar to GetPayloadValueBean, RemovePayloadValueBean and PutPayloadValueBean) and passed the source payload (as CDATA) in a additional field in the xml structure. I preserved the value of this field as a node value via GetPayloadValueBean. In the receiver channel I have called PI logout link which returns a small HTML text. In that HTML text, I inserted the preserved value via PutPayloadValueBean and then finally I got that preserved CDATA (basically the payload I had saved) back into the mapping.

    Thanks All for the response and ideas.

  • Get RSS Feed

7 Answers

  • Dec 30, 2016 at 01:14 AM

    Hi Ravi!

    In your case you can use approach with "trancated" sync-async adapter bridge. In sender adapter use RequestOneWayBean and WaitResponseBean. In receiver SOAP adapter remove default module and add NotifyResponseBean. Don't forget to set CorrelationId as required by NotifyResponseBean.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 29, 2016 at 09:20 AM

    Hello Ravi,

    In the soap sender channel did you select the quality of service as best effort?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Raghuraman,

      The question is not about best effort btw, I am already using it. Basically, I want a receiver channel which can return the response from the request. Suppose I send following data via interface

      <a> test </a>

      I want this data (<a> test </a>) back from receiver channel. Hope you get my point now.

      The interface we are talking here is already a synchronous one.

  • avatar image
    Former Member
    Dec 29, 2016 at 10:15 AM

    Hello Ravi,

    Does a Sync <> Async work for your case? Receiver comm channel (Async) use Request-Response bean and copy the payload from request to response?

    Copy value from Request message to Response message

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Nikhil,

      In request response bean, we would get the response from the receiver. How shall I copy the request data into response?

      The link you have provided talks about a particular node value, not about complete xml or an xml segment but I think something similar can be done to copy xml segments but that is custom solution. I was interested in something tricky as my requirement is quite straight forward - copy the whole request payload back into response.

  • Jan 04, 2017 at 11:04 AM

    Hi,

    Maintain Sender and receiver channels as SOAP whose source and target systems are same. And make ait Asyn scenario.

    It's easy way to do, no need of any dummy channel, because if receiver channel didn't response to sender SOAP channel, then it will throw timeout error.

    Regards,

    Anoop Rai

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 04, 2017 at 11:21 AM

    Hi Anoop,

    If I make this scenario as Async, how shall I pass the response to the synchronous caller ? The sender (3rd party) is calling the web service and expects the response back in the same session because it is a sync call. Making scenario async would not help, isnt it ?

    To add more details to my scenario -

    A third party is calling a web service in PI so I have a SOAP Sender channel. I have to do nothing in mapping or at the receiver channel. When response is to be sent back to 3rd party, I have a bean in sender channel which will do something. So the task is to bring back the original payload back to the sender channel.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 04, 2017 at 11:45 AM

    Hi,

    Ops, you require response in same session, then forget my suggestion.

    For Sync-Async bridge, you must require a sender sync interface to reply back to WaitResponseBean with Message ID or somthing that is unique as correlation. So, it will be possible using SOAP-File and again a File Adapter pick the file and respond to waiting SOAP Adapter. I also done it for one of my scenario.
    But if you ask me, i say its not a good idea, if you have no need to save that XML file. Because you are increasing load as well as file adapters may become ideal and stop its pooling intervals if no file are in path. And this development must eat your time too.
    If you want to go on my words, then create a simple sync SOAP-RFC scenario (RFC with a table structure only without writing a single line of code in it, at PI end if you wish) and response back to web service, as table structure carry your data in its full RFC way.

    Regards,

    Anoop Rai.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2017 at 02:03 AM

    Ravi,

    Did you try GetPayloadValueBean, RemovePayloadValueBean and PutPayloadValueBean option?

    https://blogs.sap.com/2013/03/20/insert-value-from-request-message-to-response-using-getpayloadvaluebean-and-putpayloadvaluebean/

    Thanks,

    Sunil

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sunil,

      I had already checked it and these beans (Get, Put) work on a node level value. So this does not solve the problem.