This document is archived and information here might be outdated.  Recommended version.


INASOEHelper Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalyst > ESRI.ArcGIS.NetworkAnalyst > Interfaces > IN > INASOEHelper Interface
ArcGIS Developer Help

INASOEHelper Interface

Provides access to methods that assist server object extension developers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Members

Name Description
Method CreateNALayer Creates a new NALayer from a network analysis layer in the map with the specified name.

Classes that implement INASOEHelper

Classes Description
NASOEHelper Helper object to assist server object extension developers.

Remarks

The INASOEHelper interface can be used to create a new NALayer based on a network analysis layer that was published in your map document.
[C#]
private IServerObjectHelper serverObjectHelper;
private INALayer2 naLayer;

public void Init(IServerObjectHelper pSOH)
{
  serverObjectHelper = pSOH; 
}

public void Construct(IPropertySet props)
{
  // In Construct of the SOE, get a reference to the NALayer in the Map named "MyRouteLayer"
  IMapServer ms = (IMapServer)this.serverObjectHelper.ServerObject;
  INASOEHelper naSOEHelper = new NASOEHelperClass();
  naLayer = (INALayer2)naSOEHelper.CreateNALayer(this.ms, ms.DefaultMapName, "MyRouteLayer");
}

private byte[] MySOEOperationHandler(
    NameValueCollection boundVariables,
    JsonObject operationInput,
    string outputFormat,
    string requestProperties,
    out string responseProperties)
{
  // In the operation, make use of the NALayer to either just get the NAContext
  // or create a new NAContext that you can populate, solve, and then throw away
  // to keep the state of the original NAContext pristine.

  // Do this to use the existing NAContext (Make sure to reset it's state after use)
  INAContext naContext = naLayer.Context;

  // Do this to create a new NAContext so the state of the original NAContext doesn't get modified
  INAContext naContext = naLayer.CopyContext();

  PopulateStuffOnTheNAContext(naContext);

  return SolveAndReturnResults(naContext);
}