A flaw in Javascript API

Discussion created by SHarihar-esristaff Employee on Nov 24, 2012
Latest reply on Nov 26, 2012 by SHarihar-esristaff
I have been building a Model builder which is hosted on the ArcServer to execute a geoprocessing task which then returns the result as a Map Layer which is overlaid over the basemap. I have been using this blog to create the toolbox.

The flaw that I found was that, when the geoprocessing tool was setup with the parameters as A Map, I receive the result layer but no attribute data associated with it. I am receiving the layer using the,

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

But this does not return the LayerInfo or any of the attribute details. This is the output image on ArcServer.

I also tried changing the parameters to A toolbox but even that does not return any feature attribute values and it also does not return any Map Layer. The code I am using to fetch the results is,

gp.getResultData(jobInfo.jobId,"final_shp", addResults, errResults);
function addResults(results) {
var features = results.value.features;
function errResults(err) {

Is this a flaw in the JavaScript API that it needs a associate MapServer to display the Map Layer. In the Flex API, we can use A toolbox and still receive the output results and the result Map Layer? In all the API examples of Geoprocessing tool, I have seen that the GPServer has a associated MapServer. Is it not possible to fetch the result Map Layer along with result attribute Info?

I am using ArcServer 10.03 and JavaScript API for my project. Pls provide a solution.