How to use
See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.
Data has been provided for your use with this sample. It can be found at
<Your ArcGIS Developer Kit Install directory>/Samples/data/SanFranciscoNetwork.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders.
However, you will need to update the sample to point to the location of the data once you have extracted all the files.
- Publish a network analysis service (see the following section).
- Open the solution file in Visual Studio.
- In the Solution Explorer, right-click References, and choose Add Web Reference.
- Type in the following URL: http://<server>:6080/arcgis/services/SanFrancisco/MapServer/NAServer?wsdl, then click Go.
- In the Web Reference Name control, type the name WebService.
- Click Add Reference.
- Save the solution.
- Build and run the project.
- Choose the route solver options.
- Click the Find Route button.
- Click the different tabs to get the solver results according to your NAServerRouteParams.
Publish a network analysis service
- Open ArcMap.
- Open <Your ArcGIS Developer Kit install folder>\samples\data\SanFrancisco\SanFrancisco.mxd.
- Navigate to File > Share As > Service.
- Choose Publish a service, and click Next.
- Choose the Publisher connection to ArcGIS 10.1 for Server, which will host the published document.
- Click Next, then click Continue.
- Choose Capabilities and check the Network Analysis check box.
- Click the Analyze button and address any significant issues that may be present.
- Click the Publish button. Note: If the publishing connection does not have "Copy data to the server when publishing" selected, SanFrancisco.gdb should be present on the server in exactly the same location as on the publishing machine.
Route_WebServiceClass.cs | Code for the main form. |
Route_WebServiceClass.vb | Code for the main form. |
Download the files for all languages
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine: Network Analyst |
ArcGIS for Desktop Basic: Network Analyst | ArcGIS for Desktop Basic: Network Analyst |
ArcGIS for Desktop Standard: Network Analyst | ArcGIS for Desktop Standard: Network Analyst |
ArcGIS for Desktop Advanced: Network Analyst | ArcGIS for Desktop Advanced: Network Analyst |