on 07-18-2019 6:30 PM
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/REST","HeaderAuthorization");
conf.put(key1, token);
return token;
Hello Kevin,
In the REST receiver communication channel under 'REST URL' Tab you can specify the pattern variable replacement correctly. Since the Authorization is generated dynamically the pattern variable replacement looks like. I could
Value Source: Adapter-Specific Attribute
Pattern element Name: Authorization
Adapter Specific Attribute: Custom Attribute
Attribute Name: Authorization
Also ensure in the UDF code the attribute name is changed from Header Authorization to Authorization only.
Now Under 'HTTP Headers' Tab you can specify the HTTP headers as below:
Header Name: Authorization
Value Pattern: Bearer {Authorization}
Thanks and Regards - Rajesh PS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
I tried same thing what you suggested above, but its not working for me.
Can you please advise what am missing here ?
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/REST","Authorization");
conf.put(key1, var1);
return var1;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varun K:
I have the same issue as yours . Do you have resolved this issue ? Appreciate your reply !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Under "Pattern variable replacement" can you change it from Adapater specific to custom attribute.
If you still facing issue please add the error screenshot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varun/Rajesh,
We have a similar requirement, where we need to pass the generated token value to the nwBPM flow as header. we have followed exactly the same process and UDF as mentioned in the blog and we are getting the error : "Server returned code: 415" and
" HTTP error occurred: Unsupported Media Type 8/11/2020 03:28:37.087 PMErrorMP: exception caught with cause com.sap.aii.adapter.rest.ejb.common.exception.HttpCallException: HTTP POST call to http://po url/bpm/pwccom/syscentricdevgooglesdmsc/TriggerUploadProxy?wsdl not successful. Unsupported Media Type"
Can you please share how did you fix this error.
Adding screenshots:-
1) UDFudf.jpg
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/REST","Authorization"); conf.put(key1, var1); return var1;
2) REST URL rest-url.jpg
3) HTTP Header http-header.jpg
4) Error : error.jpg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This solution worked once I changed channel configurations as shown.workingconfig.jpg
Please mention the error details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.