Wcf Service and ArcObjects Geoprocessing

1329
2
02-19-2013 11:01 AM
SamuelPienaar
New Contributor
Okay. We had and ArcGIS 10 Add in. The Add in allowed the user to draw and area on the map. That specified area then gets exported to shp, dxf and zipped for the user. To do this we created a Wcf Service that checked out an ArcGIS Desktop License. The serivce was 32 bit, .NET FrameWork 3.5 and used some of the Analaysis tools and so on found in ArcToolbox and we coded this using ArcObjects. The reason for using an Wcf service was that we also had a silverlight Web application that used the same service to do the same thing.
This all worked very well. Now we wanted to upgrade the client to ArcGIS 10.1. Initiallly we just upgraded to ArcGIS 10.1, used the new dlls and upgraded the service to .NET FrameWork 4.0 and changed to license initialize to use an ArcGIS Desktop Advance License. The application compiles and I can make calls to the web service that include ArcObjects functionality with out problem unitil we get to and Geoprocessing.Excecute method. The web service fails every it gets called. The data is small and alll the web configurations have been set. As I say this all worked in ArcGIS 10. We tried changing the web service to a 64 bit application and checking out a ArcGIS Server license. This works but as soon as we get to a call that calls any GP.Execute it fails. Any other ArcObjects code creating featueres works fine in a method that then gets called via the wcf service except for GP.Execute. Also I tested the method by running it via a Console app instead of wrapping it around a method and it works fine. Help would be appreciated. Sample of a typical method call is:
  public string ClipLayer(string workingFolder, string clipShapeName,string featureClassName, string OutPutFeatureClassName)
  {
   try
   {
                IVariantArray parameters = new VarArrayClass();
                parameters.Add(workingFolder + "\\" + featureClassName);
                parameters.Add(workingFolder + "\\" + clipShapeName);
                parameters.Add(workingFolder + "\\" + OutPutFeatureClassName);
                _GP.OverwriteOutput = true;
                IGeoProcessorResult2 result = new GeoProcessorResultClass();
                result = _GP.Execute(@"Clip_analysis", parameters, null) as IGeoProcessorResult2;
    return _GP.GetMessage(0);
   }
   catch (Exception exp)
   {
    throw new Exception(exp.Message);
   }
  }
0 Kudos
2 Replies
RichardWatson
Frequent Contributor
Post the full details of the exception.
0 Kudos
SamuelPienaar
New Contributor
An error occurred while receiving the HTTP response to http://localhost/DxfExportService/Service1.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

The problem with the exception is that if I do anything else within the method for example create a new feature class with fields and copy it do disk the wcf service wrapped around it executed fine. The moment I try to do any gp.execute processes it fails with this very general communication exception. The server logs don't give any other additional information. The web service is under and application pool that uses my administrative account as the identity its using .NET FrameWork 4.0 as well. And I have tried both 32 bit, any cpu and 64 bit for deployment.
0 Kudos