Skip to Content
0
Former Member
Dec 18, 2015 at 11:00 AM

Reading url from REST sender adapter

1441 Views

I am facing error when i try to read the value from url of sender REST adapter

I followed this blog.

http://host:port/RESTAdapter/Hub/Employee/<employeenumber>


here this part employeenumber is dynamic.


When I run the interface, I am not getting the correct rsponse. If I hard code in the mapping the input value, I get the correct response so something wrong with my code.


this is the code i used


public String getASMA(String namespace, String attribute, Container container) throws StreamTransformationException{

Map<String, Object> all = container.getInputHeader().getAll();

DynamicConfiguration dynConf = (DynamicConfiguration)all.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create( namespace, attribute);

String value = dynConf.get(key);

return value;

}

in mapping I did like this

two constants mapped to udf at input side and the output mapped to the value that i need to fill

first constant is employeenumber

second constant is http:// sap.com/xi/XI/System/REST

what is the wrong? I am entering two constants