Skip to Content
0

Mirroring synchronous response in SAP PI

Dec 29, 2016 at 09:16 AM

684

avatar image
Former Member

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.

10 |10000 characters needed characters left 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.

0
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Evgeniy Kolmakov Dec 30, 2016 at 01:14 AM
1

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.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy,

I am checking this. Will get back.

0

Ravi,

Didnt Eve suggestion work ? i see its really an interesting answer.

Br,

Manoj

0

You can find a more step by step approach to the suggestion from Evgeniy here: https://wiki.scn.sap.com/wiki/display/XI/Step+by+step+guide+on+Sync+Async+Bridge+without+BPM

Cheers

Chris

0
Raghuraman S Dec 29, 2016 at 09:20 AM
0

Hello Ravi,

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

Show 1 Share
10 |10000 characters needed characters left 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.

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

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

Show 1 Share
10 |10000 characters needed characters left 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.

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

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 04, 2017 at 11:21 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 04, 2017 at 11:45 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 06, 2017 at 02:03 AM
0

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

Show 1 Share
10 |10000 characters needed characters left 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.

0