Sebastian Uecker - Monday, June 2, 2014 9:14 AM:
Hi there,
I need to access the Server URL an Innovator instance was logged in to using the IOM. When I use getConnection() there is just methods to get the DatabaseName but nothing to get the ServerURL. Is there any equivalent to the client-side getServerBaseURL in the IOM?
Best regards
Sebastian
vasant - Monday, June 2, 2014 11:27 PM:
Hi Sebastian,
You can use below line to get Server URL:
string serverURL = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
Hope it helps..
Thanks - Vasant
Sebastian Uecker - Tuesday, June 3, 2014 4:14 AM:
Hi Vasant,
thanks for your quick answer. Unfortunately this does not work for me since I'm in an external C# context and the method you mention is only available in the context of a specific ASP-Page (possibly works with internal Server Methods since the Aras Innovator page is ASP). It could be used for a workaround, but it's not actually what I'm looking for.
My purpose is to write a library method that works for external apps (Innovator created and logged in via IOMFactory) as well as for Innovator plugins (i.e. via TOC View Form -> Innovator provided by this.getInnovator()). So all I have is (multiple) Innovator objects provided from either context, having to programmatically distinguish them by their respective serverUrls using the IOM functionality.
I'm puzzled that there ought to be no getter for the ServerUrl on the HttpServerConnection-object (innovator.getConnection()) although it is provided as a parameter during login and is actually an important unique identifier when working with innovator instances from multiple servers and diverse sources. In a simple test scenario I was able to reverse engineer a server url by taking the vault-url from the connection's getUserInfo()-Item and stripping off the last part of the vault-url-pattern (the part after the last ] ), but on the one hand I'm not sure if this will work for all possible scenarios and on the other hand it feels unnecessarily "hacky"...
Is there really no straightforward way to get the url directly from the Innovator-object?
Best regards
Sebastian