Skip to Content
Jul 20, 2018 at 10:56 AM

Dynamic configuration for headers is not working


Hi Experts,

I have written a REST lookup UDF to extract the "Etag" value from the endpoint and pass to headers of receiver REST channel.

Somehow I am not able to catch the "Etag" value in the headers

can anybody please tell me the mistake in the code to make adjustments.


AbstractTrace trace = container.getTrace();

String Etag = "";

try {

//instance the channel to invoke the service.

Channel channel = LookupService.getChannel("BC_ECC", "CC_REST_CRM_ETAG_RCV");

SystemAccessor accessor = LookupService.getSystemAccessor(channel);

// The Request message in XML. THIS IS THE LOOKUP SERVICE

String RESTxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<id>" + accountID + "</id>";

InputStream inputStream =new ByteArrayInputStream(RESTxml.getBytes());

XmlPayload payload = LookupService.getXmlPayload(inputStream);

Payload RESTOutPayload = null;

//The response will be a Payload. Parse this to get the response field out. RESTOutPayload =;

/* Parse the SOAPPayload to get the SOAP Response back. The conversion rate is available under the Field Name ConversionRateResult */

InputStream inp = RESTOutPayload.getContent();

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

/* Create DOM structure from input XML */ DocumentBuilder builder = factory.newDocumentBuilder();

Document document = builder.parse(inp);

/* ConversionRate is available in the TAG ConversionRateResult in the Response XML */ NodeList list = document.getElementsByTagName("d:eTag");

Node node = list.item(0);

if (node != null) {

node = node.getFirstChild();

if (node != null) {

Etag = node.getNodeValue();

/*Dynamic configuration declaration*/

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("","eTag"); conf.put(key, Etag);

} } }

catch (Exception e) {

trace.addWarning("Error" + e);


trace.addInfo("Service executed success");