I am trying to obtain the shapefile output that I am receiving from the gpTool, which is hosted on the ArcServer, and placing it on the Map using,

gp.getResultImageLayer(jobInfo.jobId,"final_shp", imageParams, function(gpLayer) {

where gp is,

gp = new esri.tasks.Geoprocessor("http://domain/ArcGIS/rest/services/webGIS/Shock_Models/GPServer/Income_Log");

This is how it has been explained in the resource but not sure why it is not working.

The firebug gives me,

NetworkError: 500 Internal Server Error - http://webgis.arizona.edu/ArcGIS/rest/services/webGIS/Shock_Models/GPServer/Income_Log/jobs/j10905b1a50f141e0b62f1ab8ef230f51/results/final_shp?dpi=96&transparent=true&format=png8&imageSR=102100&f=image&bbox=%7B%22xmin%22%3A-14519891.438356264%2C%22ymin%22%3A637618.0139790997%2C%22xmax%22%3A-6692739.741956295%2C%22ymax%22%3A6507981.786279075%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D&bboxSR=102100&size=800%2C600

And when I goto that particular link, I get this error,

Server Error - Object reference not set to an instance of an object.

Any idea how I can correct it?


I was told to use fiddler and see the error details that is occurring over the network and this is the output that I got,

SESSION STATE: Done. Response Entity Size: 849 bytes.

== FLAGS ================== BitFlags: [ClientPipeReused, ServerPipeReused] 0x18 X-CLIENTPORT: 2010 X-RESPONSEBODYTRANSFERLENGTH: 849 X-EGRESSPORT: 2023 X-HOSTIP: X-PROCESSINFO: firefox:2248 X-CLIENTIP: X-SERVERSOCKET: REUSE ServerPipe#2

== TIMING INFO ============ ClientConnected: 15:53:51.383 ClientBeginRequest: 15:53:51.494 GotRequestHeaders: 15:53:51.494 ClientDoneRequest: 15:53:51.494 Determine Gateway: 0ms DNS Lookup: 0ms TCP/IP Connect: 0ms HTTPS Handshake: 0ms ServerConnected: 15:52:45.077 FiddlerBeginRequest: 15:53:51.495 ServerGotRequest: 15:53:51.495 ServerBeginResponse: 15:53:51.679 GotResponseHeaders: 15:53:51.679 ServerDoneResponse: 15:53:51.679 ClientBeginResponse: 15:53:51.679 ClientDoneResponse: 15:53:51.679

Overall Elapsed: 00:00:00.1850106

The response was buffered before delivery to the client.

== WININET CACHE INFO ============ This URL is not present in the WinINET cache. [Code: 2] * Note: Data above shows WinINET's current cache state, not the state at the time of the request. * Note: Data above shows WinINET's Medium Integrity (non-Protected Mode) cache only.

But I am still confused as to what the error is? This is the application.

  • Did you fix it? It looks like the application is working...
    – Mintx
    Commented Nov 16, 2012 at 19:51
  • :) yes will post the answer soon, I am really swamped right now.
    – Sam007
    Commented Nov 16, 2012 at 20:24

2 Answers 2


Ok guys. After a long fought battle I was able to find the solution. A special thanks to Domenico Ciavarella. This is his blog and it beautifully explains how it is done (though you will have to use google translate and convert it to english from italian).

Now, the code that I used was correct. The problem was in the manner Geoprocessing Tool needs to be created. Yes, this might sound strange but the truth is that if you want JavaScript API to display the resultLayer, the geoprocessing Tool hosted on ArcServer needs to be also provided a Map Server (This is true at least in ArcServer 10.03). The blog explains how to create the MapService and use it along with the geoprocessing Tool.

The another reason I know this to be true, is because the previous geoprocessing tool which was failing on my JavaScript Application was working fine on Flex API. Only when I added the MapService to it does it now work as it should.

Finally I was able to resolve this problem. Strangely, very few examples were out there using getResultImageLayer. Probably this is the reason.


I have resolved this issue.

For example in ArcMap 10.0,when I publish a gp service by: enter image description here

And publish .mxd in ArcCatalog by: enter image description here

So both .mxd and gp service are published. notice: don't delete Idw_result, it can be loaded it in the code. Try to reload your program, the 500 fault disappear

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.