Select to view content in your preferred language

GPServer Submit job (get) failing

2615
6
01-08-2014 09:21 AM
jonataspovoas
Regular Contributor
I created a Geoprocess to upload an AutoCAD file (dxf) and return a Polygon contained in it. When I run the service using a post message, it runs and concludes sucessfuly. But when I try to use the service via get or Silverlight (wich also uses get) the service fails for the same file.

Here's the code that calls my service:

private void LoadCADFile(object sender, RoutedEventArgs e)
{
 var openFileDialog = new OpenFileDialog
 {
  Multiselect = false,
  Filter = "AutoCAD File (*.dxf)|*.dxf",
  FilterIndex = 1
 };
 openFileDialog.ShowDialog();

 if (openFileDialog.File == null) return;
 var fileStream = openFileDialog.File.OpenRead();

 var uploadTask = new UploadTask(@"http://oba:6080/arcgis/rest/services/SAEB/AutoCad/GPServer")
 {
  DisableClientCaching = true
 };
 
 uploadTask.UploadCompleted += CADFileLoaded;
 uploadTask.UploadAsync(new UploadParameters
 {
  FileName = openFileDialog.File.Name,
  FileStream = fileStream,
 });
}

private void CADFileLoaded(object sender, UploadEventArgs e)
{
 var geoprocessor = new Geoprocessor(@"http://myserver/arcgis/rest/services/AutoCad/GPServer/AutoCad")
 {
  DisableClientCaching = true,
  ReturnM = false,
  ReturnZ = false
 };
 geoprocessor.JobCompleted +=
  (s, args) =>
   args.JobInfo.Messages.ForEach(
    message =>
     MessageBox.Show(message.Description, message.MessageType.ToString(), MessageBoxButton.OK));
 geoprocessor.SubmitJobAsync(new List<GPParameter>
 {
  new GPItemID("Parque_de_Pituaçu_2013__wgs84__dxf",
      e.Result.Item.ItemID)
 });
}
0 Kudos
6 Replies
AnthonyGiles
Honored Contributor
Jonatas,

Have you looked at your server logs to see what may be causing the issue? Have you tried the gp service in both asynchronous and synchronous modes?

Regards

Anthony
0 Kudos
DominiqueBroux
Esri Frequent Contributor
What is the version of ArcGISServer?

If I remember well, Upload is available only from 10.1 or 10.1 SP1.
To check that, you can browse to http://oba:6080/arcgis/rest/services/SAEB/AutoCad/GPServer and verify that there is an 'Uploads' child resource.
With previous version you have to use a GPDataFile.
0 Kudos
jonataspovoas
Regular Contributor
Jonatas,

Have you looked at your server logs to see what may be causing the issue? Have you tried the gp service in both asynchronous and synchronous modes?

Regards

Anthony


Yes i have, these are the messages that my server is returning:

Job Messages:
esriJobMessageTypeInformative: Submitted.
esriJobMessageTypeInformative: Executing...
esriJobMessageTypeError: ERROR 000735: Parque de Pituaçu 2013 (wgs84).dxf: Value is required
esriJobMessageTypeError: ERROR 000735: Parque de Pituaçu 2013 (wgs84).dxf: Value is required The value is empty. ERROR 000735: Input Data Element: Value is required
esriJobMessageTypeError: Failed.

I tried to run my gp service as asynchronous and synchronous, but in both cases i had the same error.
0 Kudos
jonataspovoas
Regular Contributor
What is the version of ArcGISServer?

If I remember well, Upload is available only from 10.1 or 10.1 SP1.
To check that, you can browse to http://oba:6080/arcgis/rest/services/SAEB/AutoCad/GPServer and verify that there is an 'Uploads' child resource.
With previous version you have to use a GPDataFile.


The version of my ArcGISServer is 10.1 SP1.
0 Kudos
AnthonyGiles
Honored Contributor
It looks like your file is not getting uploaded or not making it in to your process.

Have you tried creating a parameters object and passing that object in the geoprocessorTask.SubmitJobAsync function.

Example shown here:

http://resources.arcgis.com/en/help/silverlight-api/concepts/#/Geoprocessing_task/01660000000n000000...

Regards

Anthony
0 Kudos
jonataspovoas
Regular Contributor
It looks like your file is not getting uploaded or not making it in to your process.

Have you tried creating a parameters object and passing that object in the geoprocessorTask.SubmitJobAsync function.

Example shown here:

http://resources.arcgis.com/en/help/silverlight-api/concepts/#/Geoprocessing_task/01660000000n000000...

Regards

Anthony


Yes i have, in my code below i am passing a list of GPParameters where my object parameter is a GPItemID.

geoprocessor.SubmitJobAsync(new List<GPParameter>
{
  new GPItemID("Parque_de_Pituaçu_2013__wgs84__dxf",
      e.Result.Item.ItemID)
});
0 Kudos