ArcObjects Library Reference  (Server)    

esriServer IServerObject Example

[Visual Basic 6.0]

The following code shows how to connect to a GIS server, create a server context based on a server object configuration and use the ServerObject property to get the IServerObject interface on the server context's server object:

  Dim pGISServerConnection As IGISServerConnection
  Set pGISServerConnection = New GISServerConnection
  pGISServerConnection.Connect "padisha"
  
  Dim pSOM As IServerObjectManager
  Set pSOM = pGISServerConnection.ServerObjectManager
  
  Dim pContext As IServerContext
  Set pContext = pSOM.CreateServerContext("MyMapServer", "MapServer")
  
  Dim pServerObject As IServerObject
  Set pServerObject = pContext.ServerObject
  
  Dim pMapServer As IMapServer
  Set pMapServer = pServerObject
  
  ' Do something with the mapserver
  
  pContext.ReleaseContext


[Visual Basic .NET, C#, C++]
No example is available for Visual Basic .NET, C#, or C++. To view a Visual Basic 6.0 example, click the Language Filter button Language Filter in the upper-left corner of the page.