Skip to Content
0

Looking for a help to build URL in REST

Apr 02 at 01:31 PM

78

avatar image
Former Member

Hi Experts,

I would like to construct URL and what ever values in the URL need to be read and mapped in the mapping with dynamic configuration. I am using REST sender adapter with HTTP operation 'GET' . in the rest resource I have maintained in the Dynamic attributes

what variable will be selected for URL ?

in value source is it Get variable or URL pattern Element? based on the above how can we create URL?

http://XXXXXX.com:50000/RESTAdapter/appointmentAndAdvisement/ { }

Do we need to write URL pattern with variables in the below ?

/{operation}/businessID/{businessID}/installation/{instalation}

How many types can we generate URLs?

Thanks

Praveen

rest-sender.png (18.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Apr 03 at 05:51 AM
0

Hi,

Set all custom attributes while transforming the message using UDF.

Regards.

Anoop Rai

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you Anoop. I would like to understand the difference between value source " Get Variable" & URL Pattern element . How can we use both of them in the mapping ? I understood , how to use Get Variable in the udf getting the value from the URL to map values in the message mapping but where as URL Pattern element , how to use it in URL and udf? Could you please provide an example to use both of them in the dynamic URL and also populate those value in to message mapping ?


Thank you

Praveen

0
Former Member

Hi,

URL Pattern Element : In simple words, its path param. And you need to put it as path of URL

GET Variable : Its a query param.You need to put it in URL like : ?<variable_name>=Value

Ex:-

URL : /RESTAdapter/pi/resttest/ItemData/ITD001?filterValue=52

Here, ITD001 : Its a path param

and filterValue=52 : Its a query param

Using GET Variable we can access query param values.

Regards,

Anoop Rai

0
Former Member

Thank you very much... Anoop.

How to read those two variable from URL?

I understood that reading query param from URL where as for path param , is it same like query param or we need read path param with any other way .


Thanks

Praveen

0
Former Member
Former Member

Hi,

You can access both using UDF as both attributes set in dynamic configuration with namespace = "http://sap.com/xi/XI/System/REST".


For URL : /RESTAdapter/pi/resttest/ItemData/ITD001?filterValue=52

In Dynamic configuration:-

Record name="id" -- value "ITD001"

Record name="filterValue" -- value "52"

Use it first and let us know, whats your actual problem. For tutorial please read SAP Documents for REST Adapter:-

https://help.sap.com/viewer/5cf7d2de571a45cc81f91261668b7361/7.5.9/en-US/4606831f0f4d4dc9b1a6fd9250488197.html

Regards,

Anoop Rai

capture.jpg (44.2 kB)
0