How to call REST API at SOE using HTTPS

609
1
02-18-2019 09:34 AM
KarlHuber
New Contributor III

Hi,

We're working with a Geodatabase instance that comes from a feature service (Connector is ServiceConnectionProperties, URL is like 'https://localhost/server/rest/services/MyService/FeatureServer '). There's also a map server available to our URL that exposes a Server Object Extension that we want to call in the same context as the geodatabase (like ''https://localhost/server/rest/services/MyService/MapServer/exts/MySoe/MyRestApi'). But since this is an HTTPS Uri all calls to REST endpoints need to have a token.

Can somebody tell me how to retrieve the token that is currently used with the (Service) Geodatabase so that I can use it for my further calls to the SOE? Though I can retrieve a Token from the active portal I'm currently connected using

var arcGisPortalManager = ArcGISPortalManager.Current;

var arcGisPortal = arcGisPortalManager.GetActivePortal();

var token = arcGisPortal?.GetToken();

but that's not neccessary the token that is used by this Feature Service.

So in short: How can I retrieve the token from the Geodatabase?

Many thanks in advance!

Karl

0 Kudos
1 Reply
JimGrinwald
New Contributor II

I, too would be interested in whether the Pro SDK has anything specific on this, including maybe a sample.  All I have come across in the SDK document is IServerObjectExtension, and the methods an implementer would need to do.  There is documentation that talks about communications being done via REST, but certain operations, like Query, Search, ApplyEdits.  When one drills down into the code, one specifically gets right into InterOp.  It seems to me that SOE's would be accessed in the Pro SDK using a REST client, or standard .Net documented tools for doing REST over HttpClient.

0 Kudos