

SAP PO 7.5 REST Lookup - Issues in passing dynamic values in HTTP Header and cus...
source link: https://answers.sap.com/questions/13445307/sap-po-75-rest-lookup-issues-in-passing-dynamic-va.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

SAP PO 7.5 REST Lookup - Issues in passing dynamic values in HTTP Header and custom Error handling
Hi All,
I am working on a JMS to PROXY flow in which we have got a requirement to perform REST Lookup in the message mapping by passing dynamic values(some from incoming payload and some determined by small logic) in HTTP Header of the REST Lookup call. Also, I need to print the response(custom error log) from the REST Lookup in case the HTTP response code is not 200 (for any type of error code) and fail the message. I have some issues mentioned below, kindly share your inputs.
I have tried to put the incoming variables and some other logic determined values in Dynamic Config in mapping UDF and fetch them in REST Receiver channel and map them in HTTP Header section, but what I see is,
- The values are set properly and visible in Dynamic config in main message (incoming payload), but in the Lookup channel it shows as BLANK as shown below. So no values are passed to REST API and it returns error each time. This setup works fine in POSTMAN tool.

Lookup channel log is below,

I tried to validate if the Dynamic config is having issues or not by creating a REST to REST flow and see that the values are set properly in main message.
Below is the code from UDF,
AbstractTrace trace = container.getTrace(); DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); //put header params in dynamic configuration. DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/REST","XHeaderName1"); DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/REST","XHeaderName2"); DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/REST","XHeaderName3"); conf.put(key1, DocType); conf.put(key2, msgId); conf.put(key3, BusinessID); return "";
And below is the config in REST Lookup channel,


2. I also need to catch the response from the REST Lookup to add it in the Audit log of main message and fail it in case of error, but the above error log is not available in main message. Below is the setup in REST Lookup channel in last tab. I only get a single string value for {http_result} in response payload. Is there any specific thing like creating the below structure as a separate external def or DT and use it?

3. Once I sort 1st issue, get error code from 2nd point, how to pass the above error log in Audit log, kindly let me know. I tried to follow this link and related notes and params in Module tab, but still no luck.
Thanks and regards,
Rajesh S.
Recommend
-
56
github-issues.vim Github issue integration in Vim. It's kind of awesome. Looking for a new owner If you're interested in taking over this project and giving it the love it deserves, send me an email or file a bug. ...
-
25
Three dots syntax ( ... ) became quite popular in JavaScript world in the last years. It's used for a couple of different things: object and array spread, destructuring and rest arguments. In each case, the...
-
10
Passing Query Parameters to a REST Endpoint in Jersey Keywords: Java, Jersey, JAX-RS, Query Parameters, REST, Microservices, %3F, Question Mark In this post I'll show you first how NOT to pass...
-
13
Standard Django: Passing Form Values in URL Lets say you have a form that is used to drive the next page. For example, it might contain parameters for running a report. One way to ha...
-
14
PHP passing values to variables in included files advertisements I have a php file (article.php) with variables holding con...
-
9
Building A Dynamic Header With Intersection Observer ...
-
7
Copy the dynamic range in the new workbooks, add the header and save new workbooks in the local directory before closing advertisements I have...
-
2
Pavel Polívka Posted on Dec 10...
-
4
Passing values eats my URLs advertisements Just upgraded from 1.3 to 2.0.3 and I'm trying to migrate all the changes. I'm...
-
3
Passing Any Arbitrary Value From A Power BI Report To A Dynamic M Parameter Dynamic M parameter...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK