Skip to Content

How Configure Dynamic HTTP header in REST Receiver Channel

Dec 14, 2016 at 06:29 PM


avatar image
Former Member

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 .


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key1 = DynamicConfigurationKey.create("","XHeaderName1"); DynamicConfigurationKey key2 = DynamicConfigurationKey.create("","XHeaderName2"); DynamicConfigurationKey key3 = DynamicConfigurationKey.create("","XHeaderName3"); DynamicConfigurationKey key4 = DynamicConfigurationKey.create("","XHeaderName4"); DynamicConfigurationKey key5 = DynamicConfigurationKey.create("","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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
avatar image
Former Member Mar 07, 2017 at 11:22 AM

Hi Anju,

First we need to do the cahnges in above UDF. Rename the SAOP with REST.

Communication channel configuration's are like below.

note : It will accecpt only the "_" values not "-"

In Additional Http Header :

Hope it will help you.




10 |10000 characters needed characters left characters exceeded
Harish Mistri Dec 14, 2016 at 11:02 PM


Please check the below blog for dynamic configuration attribute in Rest adapter



10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 17, 2017 at 10:05 AM

I have done my self to slove the above issue.

Show 1 Share
10 |10000 characters needed characters left characters exceeded


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( "", "XHeaderName1"); dynConf.put(key, token); return "";

However, my UDF is giving error while testing -

Exception:[java.lang.NullPointerException: while trying to invoke the method, java.lang.String) of a null object loaded from a local variable at slot 8] in class method newAccessToken[]
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?



avatar image
Former Member Mar 03, 2017 at 11:03 AM

Hi Ravinder, can you please explain how did you achieve this ?

10 |10000 characters needed characters left characters exceeded