Hi guys,
Here is my problem: I have a very basic wcf service that returns information about a feature class in my silverlight application. Everything works great in the localhost but doesn't work after publishing the application to my server. It just keeps running without throwing any error or timing out. The funny thing is that if i remove all arcobject stuff from the service code, then it works fine. Am I missing something? here is my code.
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Server);
//Initialize ESRI license
ESRI.ArcGIS.esriSystem.IAoInitialize aoIinitialize = new ESRI.ArcGIS.esriSystem.AoInitialize();
if (aoIinitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer) == esriLicenseStatus.esriLicenseAvailable)
{
aoIinitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
}
IPropertySet propertySet = new PropertySet();
propertySet.SetProperty("SERVER", "**");
propertySet.SetProperty("INSTANCE", "***");
propertySet.SetProperty("DATABASE", "***");
propertySet.SetProperty("USER", "***");
propertySet.SetProperty("PASSWORD", "****");
propertySet.SetProperty("VERSION", "***");
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
//Establish the connection with the database server
IWorkspace workspace = workspaceFactory.Open(propertySet, 0);
//Convert the workspace to feature workspace
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
//Open feature class in the database
featureClass = featureWorkspace.OpenFeatureClass(FCName);