on 10-24-2017 12:47 PM
Hi Experts,
I am using REST polling sender adapter to retrieve HTTP GET request. In this interface I need to pick the date from sender URL and pass it in Date field in mapping to the target Web service.
sample Sender URL:
http://<server_name>/api234/rowdata/bydate/2017-06-11
Please provide me your suggestions.
Thanks in advance.
Srikanth E
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu,
We are using REST polling for sender and the data should be picked on Incremental request based on timestamp of last call.
The UDF in mapping should pick the timestamp/date from the URLs and pass it to the target.
http://host:server/rowdata/bydate/{incrementalToken}
As REST Polling adapter doesn't have Adapter Specific/URL patter parameters, instead I tried to pass {incrementalToken} as input for attribute but it didn't work.
Can you please guide me further.
Thanks,
Srikanth E
Hello Sreekanth,
I don't think its possible with Standard way as I tried the same and URL or the increment requests are not recorded anywhere in SAP PO.I will check more if I can find something.
But since this is only date field why don't you map the current date in the mapping which will change everyday.
Hello Srikanth,
Using the UDF mentioned in the below link you can get the values from the rest URL and map it to that target structure of WS.
Instead of REST IDS you can define your custom attributes as well.
https://blogs.sap.com/2014/12/18/pi-rest-adapter-using-dynamic-attributes/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Srikanth,
Below is the UDF code
@LibraryMethod(title=“getASMA”, description=“get adapter specific message attribute”, category=“UDFPool”, type=ExecutionType.SINGLE_VALUE
public String getASMA (
@Argument(title=“”) String namespace,
@Argument(title=“”) 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;
Inputs are namespace which is standard -
For attribute select as per the one mentioned in channel.User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.