reg : Geoprocessing Service

2351
11
09-27-2010 09:52 AM
VikramS
Occasional Contributor
I am having problem with geoprocessing service . Below is my code behind . As soon as my MyMap_Mouseclick event is complete there is no response after tat . My browser is idle displaying the map point . Can anybody tell me what could be the problem . I have attached the JPG of my model as well

Private Sub MyMap_MouseClick(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.Client.Map.MouseEventArgs)
        _processingTimer.Start()
        Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer)
        MyMap.Cursor = System.Windows.Input.Cursors.Wait
        Dim mapPoint As ESRI.ArcGIS.Client.Geometry.MapPoint = e.MapPoint
        mapPoint.SpatialReference = MyMap.SpatialReference

        Dim graphic As New Graphic() With {.Symbol = DefaultFillSymbol, .Geometry = mapPoint}
        graphicsLayer.Graphics.Add(graphic)

        Dim geoprocessorTask As New Geoprocessor("http://epps65335.campus.ad.utdallas.edu/arcgis/rest/services/test/GPServer/Model")
        geoprocessorTask.UpdateDelay = 5000
        AddHandler geoprocessorTask.JobCompleted, AddressOf GeoprocessorTask_JobCompleted
        'AddHandler geoprocessorTask.ExecuteCompleted, AddressOf GeoprocessorTask_ExecuteCompleted

        Dim parameters As New List(Of GPParameter)()
        parameters.Add(New GPFeatureRecordSetLayer("Feature_Set", e.MapPoint))
        'parameters.Add(New GPLinearUnit("Linear_unit", esriUnits.esriFeet, Double.Parse("20000")))
        'geoprocessorTask.OutputSpatialReference = MyMap.SpatialReference

        geoprocessorTask.SubmitJobAsync(parameters)
    End Sub

Private Sub GeoprocessorTask_JobCompleted(ByVal sender As Object, ByVal e As JobInfoEventArgs)
        Dim geoprocessorTask As Geoprocessor = TryCast(sender, Geoprocessor)
        AddHandler geoprocessorTask.GetResultDataCompleted, AddressOf GeoprocessorTask_GetResultDataCompleted
        geoprocessorTask.GetResultDataAsync(e.JobInfo.JobId, "Output_Feature_Class", e.JobInfo.JobId)
    End Sub
0 Kudos
11 Replies
JenniferNery
Esri Regular Contributor
Do you change your map cursor after GeoprocessorTask_GetResultDataCompleted? Or does it remain on System.Windows.Input.Cursors.Wait?
0 Kudos
dotMorten_esri
Esri Notable Contributor
You might want to listen for the Failed event as well. Your request is probably failing.
If that's the case, first make sure the service works from the plain HTML REST interface. The look in Fiddler (www.fiddlertool.com) and try and understand what requests and responses (or lack of) that there are. Did any fail? Did the request parameters look ok? What did the server respond? etc.
0 Kudos
VikramS
Occasional Contributor
Hi Morten ,

I installed fiddlertool . I am getting below error .
{"error":{"code":500,"message":"Error Submitting Job","details":[]}}

You might want to listen for the Failed event as well. Your request is probably failing.
If that's the case, first make sure the service works from the plain HTML REST interface. The look in Fiddler (www.fiddlertool.com) and try and understand what requests and responses (or lack of) that there are. Did any fail? Did the request parameters look ok? What did the server respond? etc.
0 Kudos
dotMorten_esri
Esri Notable Contributor
Were you able to execute the tool from the HTML webpage outside of Silverlight?
0 Kudos
VikramS
Occasional Contributor
Now i am getting this error ..It is giving {"error":{"code":500,"message":"Job \u0027jcec98feb7d9f4ed19ae1b1b8357b9686\u0027 does not exist or is inaccessible.","details":[]}}

Hi Morten ,

I installed fiddlertool . I am getting below error .
{"error":{"code":500,"message":"Error Submitting Job","details":[]}}
0 Kudos
dotMorten_esri
Esri Notable Contributor
It sounds like you a trying to access a job that hasn't been created.
Did you call SubmitJob first? Is your GP tool even asynchronous? (if not you should execute the tool and not submit it)
0 Kudos
VikramS
Occasional Contributor
CAn u pls tell me what input do i need to give to check whether my tool is working out of silverlight
I have attached the Submitjob Snapshot ..That would be a great help ..

It sounds like you a trying to access a job that hasn't been created.
Did you call SubmitJob first? Is your GP tool even asynchronous? (if not you should execute the tool and not submit it)
0 Kudos
dotMorten_esri
Esri Notable Contributor
That really depends on how you configured your service and what it expects (look at the previous page that describes the service metadata for specific details on the parameters). Next click the "Help" link in the upper right to read about the expected syntax.

Make sure that when you execute your GP tool from Silverlight, that the parameters you provided is of the same type as the Input parameters specify in the mentioned metadata.
0 Kudos
VikramS
Occasional Contributor
Now i m getting the below error .. {"jobId":"jc2f7f9358aea47d1abe29965a0b42bd9","jobStatus":"esriJobFailed","results":[],"inputs":[],"messages":[{"type":"esriJobMessageTypeInformative","description":"Submitted."},{"type":"esriJobMessageTypeInformative","description":"Executing..."},{"type":"esriJobMessageTypeError","description":"Failed."}]}

I have attached the metadata of my service as well with this reply .. I am not having any clue where am i going wrong .. Can u put some light on it .. Thanks


That really depends on how you configured your service and what it expects (look at the previous page that describes the service metadata for specific details on the parameters). Next click the "Help" link in the upper right to read about the expected syntax.

Make sure that when you execute your GP tool from Silverlight, that the parameters you provided is of the same type as the Input parameters specify in the mentioned metadata.
0 Kudos