Select to view content in your preferred language

Geoprocessing problem

1735
18
11-01-2010 04:35 AM
PaulHuppé
Deactivated User
Hi,

I have setup a test Python script which simply accepts 2 parameters and which returns an email to the user.  I have included the script in a Toolbox and have published the Toolbox.  If I run the Python script manually, it works.  If I run the tool using the REST interface, it works.  When I try to run it from inside my Silverlight application, it just hangs.  It does not even seem to make it to the server.  Following are some pieces of the code I am using. Can anyone spot the problem?

Thanks,
Paul

            string restServerURL = "http://myserver.name/ArcGIS/rest/services/";
            Geoprocessor geoprocessorTask = null;
            // Start timer for task
            _processingTimer = new System.Windows.Threading.DispatcherTimer();
            _processingTimer.Interval = new TimeSpan(0, 0, 0, 5, 0);
            _processingTimer.Tick += ProcessingTimer_Tick;
            _processingTimer.Start();
            geoprocessorTask = new Geoprocessor(restServerURL + "TestSendEmail/GPServer/SendEmail");
            geoprocessorTask.UpdateDelay = 5000;
            geoprocessorTask.JobCompleted += GeoprocessorTask_JobCompleted;
            List<GPParameter> parameters = new List<GPParameter>();
            // Pass the user's email to send them the zip file
            parameters.Add(new GPString("EmailTo", tbEmail.Text));
            // Pass the layer names to the Geoprocessing service
            parameters.Add(new GPString("DesiredLayers", _layerNames));
            geoprocessorTask.SubmitJobAsync(parameters);
0 Kudos
18 Replies
JenniferNery
Esri Regular Contributor
Have you tried running Fiddler while you run your SL app to see where it hangs?  Also, have you tried debugging the SL app to see if the parameters it passes to your task are correct?  Can you also try to use the same parameters in the browser? You can look at this post for reference post# 14 http://forums.arcgis.com/threads/14730-Area-And-Perimeter
0 Kudos
PaulHuppé
Deactivated User
Hi Jennifer,

I have tried debugging the SL app and the parameters are ok.  I got the information from Fiddler and tried it in the browser

http://s5-bsc-ims2.nrn.nrcan.gc.ca/ArcGIS/rest/services/TestSendEmail/GPServer/SendEmail/submitJob?EmailTo=huppe%40nrcan.gc.ca&DesiredLayers=Big+Lakes%7cBoundary%7cInternational+Borders%7cProvinces%7cSendEmail&f=json&HTTP/1.1

I got the following result:

{"error":{"code":500,"message":"Error Submitting Job","details":[]}}

But, if I do the same thing via the REST intnterface,


I get:


Paul
0 Kudos
JenniferNery
Esri Regular Contributor
You used the same parameters found in Fiddler under Inspectors > WebForms tab?  The error 500 that you see is a ServiceException from JSON. Unfortunately there are no further details, usually details will say invalid input. But you said the parameters from SL app when used in the browser will submit the job without error.  I'm not sure what to tell you. I'll check whether URL encode has something to do with it.
0 Kudos
PaulHuppé
Deactivated User
Yes, I used the same parameters.  It sucks that we do not get any information from the error message.  It does not help much!!  I wish I knew what to try next!
0 Kudos
JenniferNery
Esri Regular Contributor

http://s5-bsc-ims2.nrn.nrcan.gc.ca/ArcGIS/rest/services/TestSendEmail/GPServer/SendEmail/submitJob?E... DesiredLayers=Big+Lakes%7cBoundary%7cInternational+Borders%7cProvinces%7cSendEmail&f=json&HTTP/1.1 


Is this the correct input name?
0 Kudos
PaulHuppé
Deactivated User
Hi Jennifer,

Yes, that was it!!!  I have been starring at this stuff for so long, I could not spot the obvious.

Thanks,
Paul
0 Kudos
RichardKaufholz
Deactivated User
Hi Guys,

I know this thread is old, but I am so happy that you helped me find my problem, I wanted to say thanks.

You know, I spent SO much time checking, and re-checking the input parameter values and testing using the services directory, I never actually double checked the input parameter names themselves. Duh!

Such relief!

Cheers,
Richard.
0 Kudos
PaulHuppé
Deactivated User
Hi,

Glad this could help. Sometimes the obvious errors are the hardest to spot!!!

Cheers,
Paul
0 Kudos
morgandawe
Emerging Contributor
Hello folks, i am having the same issue, and i was wondering what the restrictions are for naming conventions in geoprocessing task parameters (async). I have a service with 3 parameters, all are of GPFeatureRecordSetLayer dataType. I know the names are strange, but thats just the way our in house dev team set them up so i can test them. They are as follows(everything within the "" is a part of the parameter name):

"Enter a Graphical Boundary or a Boundary Feature Class:"
"Traffic_Zone_2001_POP2001"
"Blank.DBO.Blank_Boundary_Land"

the url i am using in the geoprocessing task is as follows:

http://geoserver1/ArcGIS/rest/services/YrGeoView_Population_tools/Model3/GPServer/Model 3a Traffic Zone Population Estimate

These names will change before they are delivered, but i wanted to check with the community to be sure. The 2032 stream error is so annoying. Thanks everyone
0 Kudos