cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Values from Request to response with REST adapter

former_member198060
Participant
0 Kudos

Hello all,

I am trying to pass values from the request to the response message mapping within a synchronous scenario. For this, I am storing values into the dynamic configuration header using a custom namespace.

This has worked for other scenarios before, but it doesn't seem to work for a SOAP to REST scenario where I can see the fields in the request message header but in the response none of these fields is available.

Also if I try to use the REST namespace instead of my custom namespace, the fields are not available in the response.

Has anybody had the same issue or a work around for this?

former_member182412
Active Contributor
0 Kudos

Hi Peter,

How did you resolve this issue, can you share your solution??

Regards,

Praveen.

former_member190293
Active Contributor
0 Kudos

Hi Praveen!

I think he used approach suggested by Manoj: storing values from Dynamic Configuration to module variables using DynamicConfigurationBean before calling SAP adapter module and restoring it back after that. In further response mapping values are put to payload from DC using UDF.

Regards, Evgeniy.

former_member182412
Active Contributor
0 Kudos

Hi Evgeniy,

Did you see my reply below DynamicConfigurationBean will not work for REST adapter because in the rest adapter when get the response it is creating new module data and all saved variables were lost, check my reply below.

Regards,

Praveen.

former_member190293
Active Contributor
0 Kudos

Sorry, Praveen! I missed your answer.

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor

Peter ,

I guess the rest adapter overrides the header fileds try using DynamicConfigurationBean as well.

https://blogs.sap.com/2015/08/28/copy-value-from-request-message-to-response-message-using-dynamicco...

OR

Using Get/Put Payload Bean:

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

Br,

Manoj

Answers (2)

Answers (2)

former_member182412
Active Contributor

Hi Peter,

DynamicConfigurationBean creating new Hashtable for first time and keep the values in the Hashtable, If the Hashtable already exist in the module context then it retrieve using mp.context parameter like below and using in the module that is why you will have two times DyanmicConfigurationBean module, one will save the value in Hashtable and other one to retrieve the value from the Hashtable which is in module context. This will work for all the adapters.

But REST adapter is creating the new module data again so already saved values were lost after the RestAdapterBean module execution that is why it is not working for REST adapter.

Regards,

Praveen.

.

Former Member

Hello Praveen, Evgeniy,

This root cause for this issue is fixed with SAP Note 2212660 - Async/Sync Bridge with REST receiver channel is failing.

When you apply it you will be able to use DynamicConfigurationBean.

Best regards,

Dimitar

former_member182412
Active Contributor
0 Kudos

Thanks for updating the thread with correction details.