Setup an application with the Web ADF and ArcGIS Server libraries using the sample description as a guide.
Set the username, password, and domain variables to a user account in the agsuser or agsadmin groups on the SOM. Define the servername variable to be the machine on which the SOM is running.
Set the serverobjectname to the name of an ArcGIS Server map service.
[C#]
// Using the ArcGIS Connection library
ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity(userName, password,
domain);
ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsServerConnection;
agsServerConnection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection
(serverName, identity);
agsServerConnection.Connect();
// Using the ArcGIS Server API
ESRI.ArcGIS.Server.IServerObjectManager serverObjectManager =
agsServerConnection.ServerObjectManager;
string serverType = "MapServer";
ESRI.ArcGIS.Server.IServerContext serverContext =
serverObjectManager.CreateServerContext(serverObjectName, serverType);
// If pooled, release context per request. If non-pooled, release context per session.
serverContext.ReleaseContext();
[VB.NET]
' Using the ArcGIS Connection libraryDim identity As ESRI.ArcGIS.ADF.Identity = New ESRI.ArcGIS.ADF.Identity(userName, password, domain)
Dim agsServerConnection As ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection
agsServerConnection = New ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(serverName, identity)
agsServerConnection.Connect()
' Using the ArcGIS Server APIDim serverObjectManager As ESRI.ArcGIS.Server.IServerObjectManager = agsServerConnection.ServerObjectManager
Dim serverType AsString = "MapServer"Dim serverContext As ESRI.ArcGIS.Server.IServerContext = serverObjectManager.CreateServerContext(serverObjectName, serverType)
' If pooled, release context per request. If non-pooled, release context per session.
serverContext.ReleaseContext()