Initializes a new instance of the ServiceConnectionProperties class. This class constructor can be used to define the connection information to a subservice of an ArcGIS Server 3D globe service, or to a subservice of a WMS Service.

Namespace:  ESRI.ArcGISExplorer.Data

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

Syntax

C#
public ServiceConnectionProperties(
	ServiceType ServiceType,
	Uri url,
	string serviceName,
	string subServiceName
)
Visual Basic (Declaration)
Public Sub New ( _
	ServiceType As ServiceType, _
	url As Uri, _
	serviceName As String, _
	subServiceName As String _
)

Parameters

ServiceType
Type: ESRI.ArcGISExplorer.Data..::.ServiceType

One of the ServiceType values which defines the type of service.
url
Type: System..::.Uri

A Uri object which represents a Uniform Resource Identifier and consists of a string of characters used to identify the service on the Internet.
serviceName
Type: System..::.String

The name of the service.
subServiceName
Type: System..::.String

The name of the sublayer of the service.

Examples

The code below demonstrates how to define the connection information to an ArcGIS Server globe subservice using a ServiceConnectionProperties object. 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,
                                                 new Uri("http://services.arcgisonline.com/arcgis/services"),
                                                 "NPS_Physical_World",
                                                 "Physical");

    //Create a new ServiceLayer
    ServiceLayer globeService = new ServiceLayer(connProps);

    //Try to connect the layer to the service
    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);
    }
    else
    {
        //Investigate connection issue.
        ConnectionStatus status = globeService.ConnectionStatus;
        if (status.HasError)
        {
            System.Diagnostics.Debug.Print(status.ErrorString);
        }
    }
}
CopyVB.NET
'Define the connection properties to the Physical subservice in the NPS_PhysicalWorld Globe service
Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(ServiceType.GlobeServer, _
                                                     New Uri("http://services.arcgisonline.com/arcgis/services"), _
                                                     "NPS_Physical_World", "Physical")

'Create a new ServiceLayer
Dim globeService As ServiceLayer = New ServiceLayer(connProps)

'Try to connect the layer to the service
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)
Else
  'Investigate connection issue.
  Dim status As ConnectionStatus = globeService.ConnectionStatus
  If (status.HasError) Then
    System.Diagnostics.Debug.Print(status.ErrorString)
  End If
End If

See Also