ArcGIS Simple Edit service


Purpose
This sample demonstrates how to create an application Web service that utilizes remote ArcObjects, via ArcGIS Server, to perform simple edits on a feature class in a geodatabase. In this sample, the feature class contains points (ServiceCalls) and resides in a file geodatabase. The Web service accepts the following inputs for adding a new service call:
  • Name
  • Details
  • Service type
  • Location
ArcObjects geodatabase components are used to manage the edit operation in a pooled service environment. Server context is created and released for each Web request to the service. The Web service requires that the ArcGIS Engine runtime or ArcGIS Server Application Developer Framework (ADF) runtime is installed.
 
A Web application is also included with this sample to illustrate how a Web ADF client can integrate this service with existing ADF controls and patterns. From the ADF client perspective, a Web reference is added to the application, and the service is utilized via a Simple Object Access Protocol (SOAP) interface. The SOAP interface is defined by the Web service types and methods; it is not dependent on nor related to the ArcGIS Server SOAP application programming interface (API).
 
Since SOAP Web services are inherently stateless, server context is created and released upon each request. If the feature class is being edited when another request is received, an error is returned to the client.

How to use

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/Montgomery/MontgomerySimple.mxd.
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.

At design time
  1. Assuming both the Web service and application are being installed on the same machine, verify that the Web ADF for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
  2. In Windows Explorer, navigate to <ArcGIS Developer Kit install location>\Samples\ServerNET\ArcGIS_SimpleEdit.
  3. Open the directory of the language you're going to use—CSharp or VBNet—and copy the ArcGIS_SimpleEdit_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
  4. Set up access to the data by following the steps in the Set up access to the data section below.
  5. Create the map service by following the steps in the Create the map service section below.
  6. Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
  7. In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, or navigate to the Web site on which you would like to configure the sample.
  8. Open the ArcGIS_SimpleEdit_<language> folder, right-click the ArcGIS_SimpleEdit_WebService folder, and click Properties. The Properties dialog box opens.
  9. Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
  10. Open the ArcGIS_SimpleEdit_<language> folder, right-click the ArcGIS_SimpleEdit_WebApp<language> folder, and click Properties. The Properties dialog box opens.
  11. Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
  12. Start Microsoft Visual Studio 2008 or 2010, and open the ArcGIS_SimpleEdit_<language> solution (for example, ArcGIS_SimpleEdit_CSharp2005.sln) located in c:\inetpub\wwwroot\ArcGIS_SimpleEdit_<language>\ArcGIS_SimpleEdit_<language><vs_version>. The <vs_version> references the Visual Studio version of the solution, either 2008 or 2010.
  13. In Solution Explorer, right-click the ArcGIS_SimpleEdit_WebApp<language> project, and select Set as StartUp Project.
  14. Right-click Default.aspx, and select Set As Start Page.
  15. Open the code-behind for the AddActionLocationService.cs (.vb if working on VB.Net) in webservice project and update the ArcGIS identity username, password and domainormachine.
  16. Click the Debug menu and click Start Debugging, or press F5. The ArcGIS_SimpleEdit application starts.
  17. Address any errors that occur in the debugging process.

At run time
  1. Open a browser and navigate to the Web application default page (for example, http://localhost/ArcGIS_SimpleEdit_CSharp/ArcGIS_SimpleEdit_WebAppCSharp/Default.aspx) or start the Web application in Visual Studio.
  2. Type a value in the text boxes next to Service Name and Service Details. Service Name is the name of the customer, and Service Details contains specific information about the service call. Use the Service Type drop-down menu to select the type of service call.
  3. Select the Add Service Call tool and click the map. A new service call with the parameters you entered is added to the map.
  4. Use the Identify Service Call tool to query current service calls in the ServiceCalls feature class. The results are returned in a table below the map.

Additional information

Set up access to the geodatabase
  1. You must have access to SQLExpress, configured for use with ArcSDE workgroup geodatabases, to use the data packaged with this sample. If you use your own data, you need to change portions of the sample code for it to function.
  2. Start ArcCatalog, click Add Database Server under Database Servers, and connect to SQLExpress.
  3. Right-click the SQLExpress instance, select Permissions, and add the ArcGIS Server container account.
  4. Right-click the SQLExpress instance, select Attach, and navigate to the Montgomery.mdf file included the samples data (for example, c:\iArcGIS\ProgramFiles\DeveloperKit10.0\Samples\Data\Montgomery.mdf). The Montgomery geodatabase is added to the geodatabase list for the SQLExpress instance in ArcCatalog.
  5. Right-click the Montgomery geodatabase, select Administration > Permissions, and grant the ArcGIS Server container account (ArcGISSOC) read and write privileges. 
 
Configure the map document and create the map service
  1. Open the MontgomerySimple.mxd file in ArcMap. Because the data source for every layer is invalid, a red exclamation point is displayed next to each layer name. 
  2. Click the red exclamation point next to the Dimension features layer to display the Set Data Source dialog box.
  3. Navigate to the SQLExpress instance where the Montgomery geodatabase is available, select the Montgomery.DBO.Dimensions feature class in Montgomery.DBO.Landbase featuredataset, and click OK. Data sources for the layers in the map document are repaired.
  4. Save the map document. The following screen shot shows how the ArcMap window looks:

    Open ArcCatalog and add a new map service with the following properties:
    • Name: MontgomerySimple
    • Map document: <path to MontgomerySimple.mxd>
    • Pooling: Pooled, Min instances: 0, Max instances 2
  5. Start the service.


ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebService\AddActionLocation.asmx Web service endpoint.
ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebService\App_Code\AddActionLocationService.cs Web service source code. Defines the public members and types as well as process logic.
ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebAppCSharp\Default.aspx Default page contains a set of custom tools to add a service call and identify existing service calls.
ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebAppCSharp\Default.aspx.cs Code behind the user interface.
ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebAppCSharp\App_Code\AddPointTool.cs Contains tool code used to add a service call using the Web service.
ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebAppCSharp\App_Code\IdentifyTool.cs Contains tool code used to identify existing service calls via the map service.
ArcGIS_SimpleEdit_CSharp\ArcGIS_SimpleEdit_WebAppCSharp\App_Code\Utility.cs Class library containing helper code.
Download the C# files
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebService\AddActionLocation.asmx Web service endpoint.
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebService\App_Code\AddActionLocationService.vb Web service source code. Defines the public members and types as well as process logic.
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebAppVBNet\Default.aspx Default page contains a set of custom tools to add a service call and identify existing service calls.
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebAppVBNet\Default.aspx.vb Code behind the user interface.
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebAppVBNet\App_Code\AddPointTool.vb Contains tool code used to add a service call using the Web service.
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebAppVBNet\App_Code\IdentifyTool.vb Contains tool code used to identify existing service calls via the map service.
ArcGIS_SimpleEdit_VBNet\ArcGIS_SimpleEdit_WebAppVBNet\App_Code\Utility.vb Class library containing helper code.
Download the VB.NET files

Download the files for all languages