Question
· Dec 1, 2017

REST-Service Call-Parameter Method in other class

Hi guys,

is there a way to get the Call-Parameter in an UrlMap to call a method that lies in another class?

Example:

I have a generic class 'RestApi' where I define all my routes for the different Rest-Services I offer - in order to get the same URL for every service.

 <Route Url="/checkUID/:uid/:supplierid/" Method="GET" Call="checkUID"/>

This way the checkUID-Method has to be in the class 'RestApi' where my routes are defined. If I dont want to have all methods implemented in the same generic class, is it possible to get the Call-Parameter to call for example the method 'checkUID' in the class 'UID'?

Thanks,

Thomas

Discussion (4)0
Log in or sign up to continue

URL map can also be splitted into several parts:

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>

<!-- Api version 1 -->
<Map Prefix="/v1" Forward="Api.v1"/>

<!-- Api version 2 -->
<Map Prefix="/v2" Forward="Api.v2"/>

</Routes>
}

And brokers in Api.v1 and Api.v2 would process the requests according to their URL Map.