Using the ArcGIS Explorer SDK you can create add-ins using Visual Studio that connect to and execute geoprocessing services.  With SDK capabilities such as TrackPoint, TrackLine, and TrackPolygon, users can create geometries on the map which can be packaged with other parameters as inputs to the geoprocessing service.  When the service has finished, outputs from the service can be displayed on the map, used in popups, and more depending on what is appropriate for the type of information returned.

The drive time analysis sample included in the SDK Help shows a working example of a DockWindow add-in being used to call a geoprocessing service and add the results to the map. Here’s an outline of the steps using the drive time analysis sample to illustrate some specific points.

First, make sure you have a supported development environment and the ArcGIS Explorer SDK installed. The SDK can be obtained from the ArcGIS Explorer download page and you can download and install Microsoft Visual Studio 2008 Express Editions for free.

Next, use the ArcGIS Explorer DockWindow project templates to create an add-in with a dockable window.

If you've not created an add-in before, you can review a recent blog post that covers the basics and also view a full walk-through on creating a custom Dock Window in the SDK Help.

In Visual Studio add a web reference to the project and enter the URL of the SOAP endpoint of the geoprocessing service that you want to work against.

This will create an API to connect to the geoprocessing service and program against it. If you have not programmed against a SOAP API before, refer to the Using SOAP to access ArcGIS Server Web Services Help topic for an introduction.

The information you need to pass in and receive back from the service will depend on the geoprocessing service that you are working with. If the service has input parameters, work out if this will be determined automatically by the add-in or if it will be chosen by the ArcGIS Explorer use scenario, and then think how you will gather this information from the user.

Also look at the output of the service and work out how you want to display this information in ArcGIS Explorer. For example, the Drive Time Analysis sample lets the user to click on the map using the MapDisplay.TrackPoint method and the resulting Point object is used to pass starting coordinates to the GP service. Here are some more tips on dealing with some of the different geoprocessing service types:

  • The GPBoolean, GPDate, GPDouble, GPLinearUnit, GPLong, GPString types can be mapped to equivalent .NET value types such as Boolean, DateTime, Double and so on - for example if these types are input to the service, add a NumericUpDown control to the DockWindow to allow the user to determine a numeric value.
  • From the GPFeatureRecordSetLayer type you can access attributes and shapes of a recordset of results. The shape from the recordset can be converted to an ArcGIS Explorer Geometry and added to the Map as a Graphic or Note. The attributes from the recordset can be formatted into content for a Note popup, or shown in a form or on the DockWindow; a similar approach can be taken with the attribute data represented by a GPRecordSet.
  • Services returning URLs to other documents or images can be incorporated into the content of the popup of an ArcGIS Explorer note or view. An example was shown during the User Conference plenary session.

Finally, program against the service to pass in information and display the result in Explorer using the input and output types you worked out in the previous step. Consider using a BackgroundWorker if the call to the service may take a while and your intended workflow means that the user can continue working while the call to the service is made. If the user must wait for the result, consider using a ProgressHelper to inform the user of progress, as shown in the Drive Time Analysis sample.