The name of the sublayer of the ArcGIS Server 3D globe subservice or WMS subservice service.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public string SubServiceName { get; set; }
Visual Basic (Declaration)
Public Property SubServiceName As String

Field Value

The name of the sublayer of the service to connect to.

Remarks

The SubServiceName property must be set when connecting a ServiceLayer to a specific an ArcGIS 3D globe service, as shown in the example code below. It can optionally be set when connecting to a WMS service, where it can be used to specify a single sublayer of a WMS service.

When using the ArcGIS Server SOAP API in conjunction with ArcGIS Explorer, the SubServiceName property can also be used to connect to a result map service containing the output of a geoprocessing service, by concatenating the tool name, output parameter name and job ID (separated by forward slashes) in the form:

Copy 
<Tool Name>/<Output Parameter Name>/<JobID>

The JobID is used internally to set the source ID for the sub layer which represents the output parameter within the map service, identifying the output data in the ArcGIS Server Jobs directory.

Examples

Example 1

The code below demonstrates how to define the connection information to an ArcGIS Server globe subservice using the properties of the ServiceConnectionProperties class. A ServiceLayer object is also created, then connected to the service and added to the map as a layer.
CopyC#
//Define the connection properties to the Physical subservice in the NPS_PhysicalWorld Globe service
ServiceConnectionProperties connProps = new ServiceConnectionProperties(ServiceType.GlobeServer);
connProps.Url = new Uri("http://services.arcgisonline.com/arcgis/services");
connProps.ServiceName = "NPS_Physical_World";
connProps.SubServiceName = "Physical";

//Create a new ServiceLayer and try to connect the layer to the service
ServiceLayer globeService = new ServiceLayer(connProps);
bool connected = globeService.Connect();

//Check to see whether the connection was successful
if (connected)
{
    //Add the layer to the map.
    ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(globeService);

}
CopyVB.NET
' Define the connection properties to the Physical subservice in the NPS_PhysicalWorld Globe service
Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(ServiceType.GlobeServer)
connProps.Url = New Uri("http://services.arcgisonline.com/arcgis/services")
connProps.ServiceName = "NPS_Physical_World"
connProps.SubServiceName = "Physical"

' Create a new ServiceLayer and try to connect the layer to the service
Dim globeService As ServiceLayer = New ServiceLayer(connProps)
Dim connected As Boolean = globeService.Connect()

' Check to see whether the connection was successful
If (connected) Then
    ' Add the layer to the map.
    ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(globeService)
End If

Examples

Example 2

The code below indicates how to use the SubServiceName property of the ServiceConnectionProperties class to retrieve the output result from a geoprocessing service which has an associated result map service. This example is relevant when using the ArcGIS Server SOAP API to work with geoprocessing services in ArcGIS Explorer. Before the geoprocessing job is submitted, appropriate code must be implemented to create a new GPServerProxy instance ('the gpServerProxy' variable in the code below), set the URL of the GPServerProxy and construct the correct input parameters (the 'inputValues' variable in the code below). Once the job has been submitted additional code must also be implemented to repeatedly check the status of the job and if the job completes successfully only then continue to retrieve the result.
CopyC#
// Submit the Geoprocessing Job (asynchronously in this example)
string JobID = gpServerProxy.SubmitJob(gpToolInfo.Name, inputValues, null, null);

// NOTE - After submitting a job, ideally check for successful job execution here.
// If the job completes successfully continue to retrieve the result from the result map service

// Create a new instance of the ServiceConnectionProperties class using the overloaded constructor
// In this example:
// 1. 'Intervisibility' is the shared top-level name of the geoprocessing service and map service
// 2. 'Point Intervisibility' is the name of the tool within both services
// 3. 'Visible_Area' is the name of the output parameter which draws the results
// 4. 'JobID' is the JobID received from ArcGIS Server when the SubmitJob method is called (above)
ServiceConnectionProperties connProps = new ServiceConnectionProperties(ServiceType.MapServer,
                                               new Uri("http://gpserver.esri.com/ArcGIS/services"),
                                               "Intervisibility",
                                               "Point Intervisibility/Visible_Area/" + JobID);

// Create a new ServiceLayer instance passing in the ServiceConnectionProperties
ServiceLayer gpJobLayer = new ServiceLayer(connProps);

// If the ServiceLayer can be successfully connected add it to the map 
if (gpJobLayer.Connect())
{
    ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(gpJobLayer);
}
CopyVB.NET
' Submit the Geoprocessing Job (asynchronously in this example)
Dim JobID As String = gpServerProxy.SubmitJob(gpToolInfo.Name, inputValues, Nothing, Nothing)

' NOTE - After submitting a job, ideally check for successful job execution here.
' If the job completes successfully continue to retrieve the result from the result map service


' Create a new instance of the ServiceConnectionProperties class using the overloaded constructor
' In this example:
' 1. 'Intervisibility' is the shared top-level name of the geoprocessing service and map service
' 2. 'Point Intervisibility' is the name of the tool within both services
' 3. 'Visible_Area' is the name of the output parameter which draws the results
' 4. 'JobID' is the JobID received from ArcGIS Server when the SubmitJob method is called (above)
Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(ServiceType.MapServer, _
                                               New Uri("http://gpserver.esri.com/ArcGIS/services"), _
                                               "Intervisibility", _
                                               "Point Intervisibility/Visible_Area/" + JobID)

' Create a new ServiceLayer instance passing in the ServiceConnectionProperties
Dim gpJobLayer As ServiceLayer = New ServiceLayer(connProps)

' If the ServiceLayer can be successfully connected add it to the map 
If (gpJobLayer.Connect()) Then
  ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(gpJobLayer)
End If

See Also