Web API Reference | MapGuide Open Source

- Overview
- Modules
- Classes

CreateFeatureSource
DescribeSchema
DescribeSchema
DescribeSchemaAsXml
DescribeSchemaAsXml
DescribeWfsFeatureType
EnumerateDataStores
ExecuteSqlNonQuery
ExecuteSqlQuery
GetCapabilities
GetClassDefinition
GetClasses
GetConnectionPropertyValues
GetFeatureProviders
GetLockedFeatures
GetLongTransactions
GetSchemaMapping
GetSchemas
GetSpatialContexts
GetWfsFeature
SchemaToXml
SelectAggregate
SelectFeatures
SelectFeatures
SetLongTransaction
TestConnection
TestConnection
UpdateFeatures
XmlToSchema
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);

Comments or suggestions? Send us feedback.