Problem: Server object extension (SOE) default properties are not applied


Server object extension (SOE) default properties are not applied to a service at the time that the SOE is enabled.


Server object extensions (SOEs) can optionally expose properties to be set by the server administrator at the time that the SOE is enabled on a service. SOE properties allow some flexibility in the way that an SOE is deployed across different services of the same type. For example, your SOE may expose a property that determines which layer in a map the SOE will use for its analysis. This could vary across services, so it is exposed as a property.

SOE properties are intended to be set through custom property pages written for ArcCatalog or Manager by the SOE developer. If no property page was developed, or if the server administrator publishes the service with the 'Publish a GIS resource' wizard (which does not show the property pages), then the default properties will not be set on the SOE. This may cause the SOE not to function properly.

SOE developers should gracefully handle the case where a value for the property cannot be found. This can be done by setting a default value directly within the SOE code inside of a catch block.

Solution or Workaround

If the SOE developer created an ArcCatalog or Manager property page for the SOE, the server administrator should use the 'Add new service' wizard to enable the SOE on the service. The 'Add new service' wizard shows the property page and allows the server administrator to apply valid property values. Alternatively, the server administrator could open the Service Properties dialog box after creating the service and access the SOE property page through the Capabilities tab.

If the SOE developer does not want to create a property page, he or she still needs to include code within the SOE to handle the case where the property is not set. This can be accomplished within in the SOE Construct method as in the following example. In this example, a property called MarkerLimit is set to default to a value of 500 if no property is found in the service configuration file (example is in C#):

public void Construct(IPropertySet props)
configProps = props;

string markerLimitString = props.GetProperty("MarkerLimit") as string;
m_markerLimit = Convert.ToInt32(markerLimitString);
logger.LogMessage(ServerLogger.msgType.warning, "Construct", 8000, "SOE custom error: No value or invalid value provided for MarkerLimit. Defaulting to a limit of 500.");
m_markerLimit = 500; // Default if property can't be read