AnsweredAssumed Answered

Getting username in SOE, ArcGIS Server 10.2

Question asked by alexeyv on Apr 10, 2015

While in SOE I'm trying to get a username of the user that is using my service through getServerUserInfo of ServerUtilities (ArcObjects Java API) but I'm getting java.lang.RuntimeException: AutomationException. I was just trying to do what's in this article ArcObjects Help for Java developers :

How to access user information in SOEs?...IServerUserInfo userInfo = ServerUtilities.getServerUserInfo(); if (userInfo != null){ String userName = userInfo.getName(); IEnumBSTR roles = userInfo.getRoles(); String role = roles.next(); while (role != null){ role = ", " + roles.next(); } }

 

Stacktrace:

Daemon System Thread [Thread-13] (Suspended (exception AutomationException))
NativeObjRef.nativeVtblInvokeNative(Rpc, byte[], String, int, String, Param[], Object[], int) line: not available [native method]
NativeObjRef.a(Rpc, byte[], String, int, String, Param[], Object[], int) line: not available
NativeObjRef.a(Rpc, Uuid, AuthInfo) line: not available
IEnvironmentManagerProxy(Dispatch).vtblInvoke(String, int, Object[]) line: not available
IEnvironmentManagerProxy.getEnvironment(IUID) line: not available
EnvironmentManager.getEnvironment(IUID) line: not available
ServerUtilities.getServerUserInfo() line: not available
MyApp.getUserCredentials() line: 193

 

Anybody has any idea why it throws exception? Thanks in advance for any help.

Outcomes