Geoprocessor : Gp service with result map service : getResultImageLayer : question

Discussion created by gasparovic on Oct 7, 2011
Latest reply on Oct 10, 2011 by gasparovic

here is other of the issues with the geoprocessing and the js api geoprocessor.
The first issue I'm having is described here

This is about the 'layer' being returned from the getResultImageLayer method of the geoprocessor object.
The background: I have a gp service running at the server (v10.0.2.3200), this is asynchronous service, and has a result map service assigned, so I'm expecting the server to draw the results.

Once the gp job is completed, I ask the server for the result layer via getResultImageLayer. In a callback function handling the result, I'm trying to at the 'layer' into the map, but I can't see anything. It's just empty.

Here are my questions:
- the resulting 'layer' is of declaredClass esri.layers._GPResultImageLayer, is that ok?
- the 'layer' has no layerInfo information, it's empty array, I reckon that's not ok
- the 'layer' has a URL similar to following, and I just don't think that one is correct, shouldn't it be MapServer somewhere??
http://someserver/ArcGIS/rest/services/GPbuffer/GPServer/Buffer GP/jobs/j928b1975df17450e9c83783507015561/results/Vysledok_GP

I've noticed, that adding a layer returned from the getResultImageLayer into the map sends out the request like this one -
which ends up in 500 Internal Server error.

could someone pls shed some more light into this for me?

I've written the code by following the samples, especially the one handling the results for the gp service with result map service. it's just not working.

Thanks heaps