ArcObjects Library Reference  (Server)    

esriServer_IServerObjectConfiguration_Example

[Visual Basic 6.0]

The following VB code shows how to connect to the ArcGIS Server called "melange", and use the IServerObjectConfiguration interface to set the properties of a new server object configuration created and added to the server with the CreateConfiguration and AddConfiguration methods on IServerObjectAdmin to create a new geocode server object configuration and add it to the server:

  Dim pGISServerConnection As IGISServerConnection
  Set pGISServerConnection = New GISServerConnection
  pGISServerConnection.Connect "melange"
  
  Dim pServerObjectAdmin As IServerObjectAdmin
  Set pServerObjectAdmin = pGISServerConnection.ServerObjectAdmin
  
  ' create the new configuration
  Dim pConfiguration As IServerObjectConfiguration3
  Set pConfiguration = pServerObjectAdmin.CreateConfiguration
  
  pConfiguration.Name = "California"
  pConfiguration.TypeName = "GeocodeServer"
  
  Dim pProps As IPropertySet
  Set pProps = pConfiguration.Properties
  pProps.SetProperty "LocatorWorkspacePath", "\\melange\Geocoding\California"
  pProps.SetProperty "Locator", "California"
  pProps.SetProperty "SuggestedBatchSize", "500"
  
  pConfiguration.IsPooled = True
  pConfiguration.MinInstances = 1
  pConfiguration.MaxInstances = 1
  pConfiguration.WaitTimeout = 10
  pConfiguration.UsageTimeout = 120

  ' add the configuration to
  the server pServerObjectAdmin.AddConfiguration pConfiguration

[Visual Basic .NET]
Public Sub ServerConfiguration()
'The following code shows how to connect to the ArcGIS Server called "melange", 
'and use the IServerObjectConfiguration interface to set the properties of a new server 
'object configuration created and added to the server with the CreateConfiguration and 
'AddConfiguration methods on IServerObjectAdmin to create a new geocode server object 
'configuration and add it to the server:  
Dim gisServerConnection As IGISServerConnection = New GISServerConnectionClass
gisServerConnection.Connect("melange")
Dim serverObjectAdmin As IServerObjectAdmin = gisServerConnection.ServerObjectAdmin
' create the new configuration
Dim configuration As IServerObjectConfiguration3 = CType(serverObjectAdmin.CreateConfiguration, IServerObjectConfiguration3)
configuration.Name = "California"
configuration.TypeName = "GeocodeServer"
Dim props As IPropertySet = configuration.Properties
props.SetProperty("LocatorWorkspacePath", "\\melange\Geocoding\California")
props.SetProperty("Locator", "California")
props.SetProperty("SuggestedBatchSize", "500")
configuration.IsPooled = True
configuration.MinInstances = 1
configuration.MaxInstances = 1
configuration.WaitTimeout = 10
configuration.UsageTimeout = 120
' add the configuration to the server 
serverObjectAdmin.AddConfiguration(configuration)
End Sub

[C#]
public void ServerConfiguration()
{
//The following code shows how to connect to the ArcGIS Server called "melange", 
//and use the IServerObjectConfiguration interface to set the properties of a new server 
//object configuration created and added to the server with the CreateConfiguration and 
//AddConfiguration methods on IServerObjectAdmin to create a new geocode server object 
//configuration and add it to the server:  
IGISServerConnection gisServerConnection = new GISServerConnectionClass();
gisServerConnection.Connect("melange");
IServerObjectAdmin serverObjectAdmin = gisServerConnection.ServerObjectAdmin;
// create the new configuration
IServerObjectConfiguration3 configuration = (IServerObjectConfiguration3)serverObjectAdmin.CreateConfiguration;
configuration.Name = "California";
configuration.TypeName = "GeocodeServer";
IPropertySet props = configuration.Properties;
props.SetProperty("LocatorWorkspacePath", "\\\\melange\\Geocoding\\California");
props.SetProperty("Locator", "California");
props.SetProperty("SuggestedBatchSize", "500");
configuration.IsPooled = true;
configuration.MinInstances = 1;
configuration.MaxInstances = 1;
configuration.WaitTimeout = 10;
configuration.UsageTimeout = 120;
// add the configuration to the server 
serverObjectAdmin.AddConfiguration(configuration);
}

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