Hi All,
My scenario is PROXY to REST whereas Dynamic HTTP headers need to pass in Rest receiver channel, this header parameter.
We have write the udf for and passing the parameter values in the udf but , we confused how to configure the values in the REST refceiver channel .
UDF:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","XHeaderName1"); DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","XHeaderName2"); DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","XHeaderName3"); DynamicConfigurationKey key4 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","XHeaderName4"); DynamicConfigurationKey key5 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","XHeaderName5"); conf.put(key1, var1); conf.put(key2,var2); conf.put(key3, var3); conf.put(key3, var4); conf.put(key3, var5); return "";
How To configure in the receiver REST channel ?
Pleas help us to achiv the same.
How to pass header name and Value Pattern in the receiver communication cahnnel.
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for this explanation, i was able to pass the Authorization Parameters via Dynamic Configuration.
However, the value of the parameters are visible in the message audit log (RESTOUT_HTTP_HEADER).
Is there anyway the Authorization Parameters can be passed in the HTTP Header as masked ?
Regards,
Krishna
Hi Ravinder, can you please explain how did you achieve this ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have done my self to slove the above issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi S RAVINDER,
I am getting access_token from REST lookup and now I am trying to add dynamic attribute and assign it a value of the acquired access token....
Could you please help me here?
my UDF for dynamic config -
finally{ // 5. close the accessor in order to free resources. if (accessor!=null) accessor.close(); } //return token; //Dynamic Configuration DynamicConfiguration dynConf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/REST", "XHeaderName1"); dynConf.put(key, token); return "";
However, my UDF is giving error while testing -
Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.put(com.sap.aii.mapping.api.DynamicConfigurationKey, java.lang.String) of a null object loaded from a local variable at slot 8] in class com.sap.xi.tf._MM_SFDC_RESTAPI_QUOTE_STATUS_UPSERT_REQ_V1_ method newAccessToken[com.sap.aii.mappingtool.tf7.rt.Context@30f2539]
See error logs for details
If I remove dynamic config line my code is giving me access_token value successfully..
How can I pass this access_token value to synamic attribute and later use it in REST receiver adapter to add custom http header value?
BR,
Rashmi
Hi,
Please check the below blog for dynamic configuration attribute in Rest adapter
https://blogs.sap.com/2015/04/14/pi-rest-adapter-define-custom-http-header-elements/
https://blogs.sap.com/2014/12/18/pi-rest-adapter-using-dynamic-attributes/
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.