Hi,
Could someone please tell me how to access ArcSDE Geodatabase, which is published as GeoData service, into IWorkspace interface using ArcObjects.
I am trying to initialize IGeoDataServer as below and then trying to cast this object to instantiate IGeoDataServerObjects interface and then call IGeoDataServerObjects::getDefaultWorkingWorkspace() to get object of IWorkspace.
static IGeoDataServer initGeoDataServerFromInternetServer(String url, String
serviceName)throws Exception{
IPropertySet propertySet = new PropertySet();
propertySet.setProperty("URL", url);
IAGSServerConnectionFactory agsServerConnectionFactory = new
AGSServerConnectionFactory();
IAGSServerConnection agsServerConnection = agsServerConnectionFactory.open
(propertySet, 0);
IAGSEnumServerObjectName enumServerObjectName =
agsServerConnection.getServerObjectNames();
enumServerObjectName.reset();
IAGSServerObjectName serverObjectName = null;
IGeoDataServer geoDataServer = null;
while ((serverObjectName = enumServerObjectName.next()) != null){
if (serverObjectName.getName().equals(serviceName)){
IName name = (IName)serverObjectName;
geoDataServer = (IGeoDataServer)name.open();
break;
}
}
return geoDataServer;
}
However, unable to cast object of IGeoDataServer neither to GeoDataServer nor IGeoDataServerObjects interface.
Please let me know if I am not clear anywhere.
Thanks &Regards,
Vara Prasad.