Perform network analysis based on the input solve parameters.
[Visual Basic 6.0] Function Solve(
ByVal NAServerSolverParams As INAServerSolverParams _
) As INAServerSolverResults
[Visual Basic .NET] Public Function Solve ( _ ByVal NAServerSolverParams As INAServerSolverParams _ ) As INAServerSolverResults
[C#] public INAServerSolverResults Solve ( INAServerSolverParams NAServerSolverParams );
[Java] public INAServersolverResults solve ( INAServersolverParams NAServersolverParams ) throws IOException, AutomationException
[C++] HRESULT Solve( INAServerSolverParams* NAServerSolverParams, INAServerSolverResults** NASolverResults );
Parameters
NAServerSolverParams [in]
NAServerSolverParams is a parameter of type INAServerSolverParams
NASolverResults [out, retval]
NASolverResults is a parameter of type INAServerSolverResults
Solve performs network analysis based on the NAServerSolverParams object (NAServerRouteParams, NAServerClosestFacilityParams, NAServerServiceAreaParams) that was passed in and returns it's output through an NAServerSolverResults object (NAServerRouteResults, NAServerClosestFacilityResults, NAServerServiceAreaParams).
Example of code showing how to solve a route network analysis problem:
//connect to the server and get access to the server context for the MapServer objects
ServerConnection conn =
new ESRI.ArcGIS.Server.WebControls.ServerConnection("MyMachine",true);IServerObjectManager pSOM = conn.ServerObjectManager;
IServerContext pServerContext = pSOM.CreateServerContext("MyMapServerObjects", "MapServer");
// Get access to the MapServer and NAServer Interfaces
IMapServer pMapServer = pServerContext.ServerObject
as IMapServer;IServerObjectExtensionManager soex = pMapServer
as IServerObjectExtensionManager;IServerObjectExtension sext = soex.FindExtensionByName("NAServer");
INAServer naServer = sext
as INAServer;
// Get the list of all route NALAyers for this MapServer objects
string[] naLayers = naServer.GetNALayerNames(ESRI.ArcGIS.NetworkAnalyst.esriNALayerType.esriNALayerRoute);
// Get access to the NASolversParameters for the first route NALayer
INAServerSolverParams solverParams = null;if (naLayers.GetLength(0) >= 1)
solverParams = naServer.GetSolverParameters(naLayers[0]) as INAServerSolverParams;
// Solve and return the NAServerResults
if (solverParams != null)
INAServerSolverResults solverResults = naServer.Solve(solverParams);