Retrieve GIS Session ID

Hello.

I am looking for a way to restore a GIS Session after a client crash.

I am using this function to create a service factory and establish a GIS session:
ServiceFactory.createServiceFactory(string serviceFactory, HashTable context)

Example contexts:
gis.username
gis.password
gis.tenant
etc

When I read through the API documentation i found another interested context, gis.sessinId.
With this you can connect direcly to a session instead of using the contexts above.

So… My question…

Is there a way to retrieve the GIS Session ID for:
(1) a service factory created with ServiceFactory.createServiceFactory(…).
(2) a configuration service created with the class CFGService(url, port).

References: AilLibrary.dll and CFGService.dll

Best regards,
Andreas

1 Like

Well…

It seems i’ve found the solution for a part of the problem on my own. This forum popped into my mind and i thought i’d post the partial-solution here. As some of you already know, a session is created for each ServiceFactory and for each Config Server license.

This is how you get the GID Session ID from a ServiceFactory instance.

First you cast the ServiceFactory instance to a WebServicesFactory:
WebServicesFactory factory = serviceFactory.ServiceFactoryImpl as WebServicesFactory;
factory.GisSessionId now contains the GIS Session ID.

You reconnect to this session by passing gis.sessionId in the context.
When doing this you must exclude gis.username, gis.password and gis.tenant from the context.

And thats it.

//Antevirus

1 Like