When I run my geoprocessing code from silveright , It fails but when I go to geoprocessing service and submit the jobs it runs sucessfully.
Note: I need to give the TRANS_ID in single quote when I run the geoproc service in the browser. double quote will fail. does it has any thing to do about my silverlight code failing.
The snap attached contains my silverlight code
Let me know if I should provide any more details. Because I could not figure out why this is happening.
From my understanding, the name of your parameter is 'Expression' and the value should be something like "TRANS_ID = '3'". So your code should be: parameters.Add(new GPString("Expression", string.Format("TRANS_ID='{0}'", transid);
After your input to change it to Expression, I tested the code. Now I saw that my geoprocessing looks like working fine. When I kept break on geoprocessorTask_JobCompleted method. I see it comes back.
But I saw that I get the status as failed when I look at the values for job status.(shown in snap)
If I got back to the browser and submit the job again. It runs sucessfully.
I have to give the the expression as shown in the snap shot.
For your reference I showed the rest definition also
Also Note that in my silverlight code I see the parameter value enclosed in double quote as u can see in snap
At first glance your code looks good, I don't see any difference between the expression you enter in the web page and the value you generated by code. If you could use fiddler to look at the requests sent to the server, that could give a clue by comparing the working request and the non working request.
2) The url submitted from browser(The working request) gis.dev.fmh.com /ArcGISWeb/rest/services/Geoprocessing/ORACLE_FMH_CLU_SP11_GeoProc/GPServer/PivotBuffer/submitJob?Expression=TRANS_ID%3D%273fc22379-ac83-47f2-aa2a-77a74d867a64%27&env%3AoutSR=&env%3AprocessSR=&f=htm
We used a URL decoder from web and then just tried decoding the above two to find whether they match with we sent. They look like these after decoding.
1) The url sent from silverlight code (The non working request)
The thing we note after we observed the decoded one that fails, is we see a \u0027 added after TRANSID= It shows that our single quote ' in silveright gets encoded to \u0027 after we sumit to the geoprocessorTask.SubmitJobAsync(parameters);
Can you guess what's happening here. We could not figure out this.
Here is the URL decoding site we found which helped to decode our URLS
After further investigations, it seems it's a bug in the encoding of the string parameters which has been fixed in 2.2. Could you try with the 2.2 beta for checking that it's really fixed?