AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual bool MgFeatureService::TestConnection ( MgResourceIdentifier resource  )  [pure virtual]

Connects to the feature source specified by the resource identifier and verifies that the feature source has been correctly configured and installed in the resource repository. See Connection To Feature Source .

.NET Syntax
virtual bool TestConnection(MgResourceIdentifier resource);
Java Syntax
virtual boolean TestConnection(MgResourceIdentifier resource);
PHP Syntax
virtual bool TestConnection(MgResourceIdentifier resource);

Parameters:
resource (MgResourceIdentifier) The resource identifier for the feature source.
Returns:
Returns true if connection was successful; otherwise returns false.
Example (PHP)
 $boolResult = $featureService->TestConnection("Library://FeatureService/testSHP.FeatureSource");

Exceptions:
MgFdoException 
Example (C#)
 using OSGeo.MapGuide;
 // the SDF file identified by this MgResourceIdentifier exists in the repository
 private MgResourceIdentifier resourceId;
 private Boolean connected;
 private MgFeatureService featureService;

 resourceId = new MgResourceIdentifier("Library://PlatformApiDocTests/SdfFeatureClass.FeatureSource");
 // see the comments preceding the class declaration for code showing the creation of MgFeatureService object
 connected = featureService.TestConnection(resourceId);