cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for a help to build URL in REST

praveen_vanga3
Participant
0 Kudos
388

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member207703
Active Participant
0 Kudos

Hi,

Set all custom attributes while transforming the message using UDF.

Regards.

Anoop Rai

praveen_vanga3
Participant
0 Kudos

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

former_member207703
Active Participant
0 Kudos

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

praveen_vanga3
Participant
0 Kudos

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

former_member207703
Active Participant
0 Kudos

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/4606831f0f4d4dc9b1a6fd92504...

Regards,

Anoop Rai