Getting ServerObjectManager from IServerObjectHelper

1864
7
09-02-2020 06:02 AM
AmitabhaSarkar
New Contributor

Could you please let me know how can I get ServerObjectManager from IServerObjectHelper as I need to create a ServerContext using C#. I am using ArcGIS Server 10.8.1.

0 Kudos
7 Replies
HarishPalaniappan
New Contributor III

You would use that just like you use other interfaces in C#

primarily the interface definition already has a method get or set ServerObject – as you will find here-> https://enterprise.arcgis.com/en/sdk/latest/windows/IServerObjectHelper_ServerObject.html

 

If you are looking for examples this may help you

https://programmersought.com/article/4663114551/

 

If you have any additional questions please feel free to contact us.

0 Kudos
nicogis
MVP Frequent Contributor

if you make a soe why do you need create a servercontext ?

0 Kudos
AmitabhaSarkar
New Contributor

Hi Domenico, Thanks very much for showing interests.

We have been using ArcGIS 10.0 since last few years. For creating a map layer image - we are using a custom code calling from a web-handler through a proxy. This code generates an image (gif) of a desired map layer so that we can show it from our application. To do so - we did followings:

- Establish a connection to ArcGis Server using GISServerConnection.

- Create Server Object Manager object.

- Create Server Context

- Using this server context we were doing required operation.

Now we are migrating the ArcGIS Server from 10.0 to 10.8.1. With 10.8.1 I am getting error in following statement.

IGISServerConnection connection = new GISServerConnectionClass();

connection.Connect("localhost:6443"); -- This statement generates Class not registered.

That is why I went for SOE development. Kindly suggest.

0 Kudos
nicogis
MVP Frequent Contributor

you can create a soe (soap or rest) and you can call it via soap or rest . In soe you put custom code arcobjects

https://enterprise.arcgis.com/en/sdk/latest/windows/652a31ce-4f02-43b5-bba9-9db26ce231af.html 

From 10.1 you cannot use dcom

0 Kudos
AmitabhaSarkar
New Contributor

I followed the article forwarded by you. Unfortunately, I am getting error in creating connection with ArcGIS Server 10.8.1.

0 Kudos
nicogis
MVP Frequent Contributor

you dont' need do a connection arcgis server. SOE lives in a service arcgis server. You create a SOE and load in a service and then you call via https:// ....

0 Kudos
AmitabhaSarkar
New Contributor

Thanks Harish for your support but I am getting null in following location:

IMapServer mapServer = pSOH.ServerObject as IMapServer;
IMapServerObjects mapServerObjs = mapServer as IMapServerObjects; --Here I am getting mapServerObjs as Null
IMap map = mapServerObjs.get_Map(mapServer.DefaultMapName); -

I have tried using IMapServer3 even though, I am getting null.

0 Kudos