Hello everyone,
I wrote a web service a few months ago, and it was working fine. Then I decided to upgrade my workstation to ArcGIS Server 10.3 and it stopped working. So I uninstalled AcGIS Server 10.3 and I installed back ArcGIS Server 10.2 and the web service still does not work.
I am using ArcGIS 10.2 client and server on my workstation. IIS .Net Framework 3.5 and ApplicationPool 2.0, VS 2010 or VS 2012. I also did tests with IIS .Net Framework 4.0 and Application Pool 4.0 and the error persists.
Please take a look to the zipped file attached to this post. It is a simplified version of the web service, it can be opened with VS 2010 or VS 2012. The line that has the problem is this one: "CType(Activator.CreateInstance(factoryType), ESRI.ArcGIS.Geodatabase.IWorkspaceFactory)", it fails with an error message "retrieving the COM class factory for component with CLSID {D9B4FA40-D6D9-11D1-AA81-00C04FA33A15}failed due to the following error: 80040111."
Also I created a Console Application using the same code and it works fine.
HELP!!!!!
<WebMethod()> _
Public Function HelloWorld() As String
' For example, connectionFile = "C:\myData\Connection to Kona.sde".
'Public Function ArcSdeWorkspaceFromFile(ByVal connectionFile As String) As IWorkspace
Try
Dim connectionFile As String
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory")
Dim workspaceFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory = Nothing
Dim wsFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory = Nothing
'
' This is where I get the error message:
'
' Retrieving the COM class factory for component with CLSID {D9B4FA40-D6D9-11D1-AA81-00C04FA33A15}
' failed due to the following error: 80040111.
'
'
workspaceFactory = CType(Activator.CreateInstance(factoryType), ESRI.ArcGIS.Geodatabase.IWorkspaceFactory)
....
Catch ex As Exception
Console.WriteLine(ex.Message)
Return ex.Message
End Try
'End Sub
Return "Hello World"
End Function