Select to view content in your preferred language

problems with added callbacks in gp.execute

811
1
08-21-2012 03:06 AM
RubénPérez
Deactivated User
Hello,

I have a problem executing some geoprocessing tasks through the REST interface. My ArcGIS Server is 10 SP3.

It's a little bit strange because until version 2.1 of Javascript my code works perfectly but since then (above 2.1) it doesn't work.

THe problem is that i'm not receiving the geoprocessing task results in the callback function and I don't know why....

This is the code:

    GetMapasBase: function(callerObj, OnCompleteFunction, OnErrorFunction){
        //erased code
         
         var params = {App_ID: String(this.appId), User_ID: String(this.userId)};

      var po = gp.execute(params);
      
      po.addCallback(dojo.hitch(this,function(results,messages){this.resultsStore.ListaMapasBase = results;}));
      po.addCallback(dojo.hitch(callerObj, OnCompleteFunction));
         
       
        }
    }


THe first callback works perfectly and there are results.

callerObj is the object that contains the onCompleteFunction and both are parameters of this function. In this second callback, the onCompleteFunction doesn't receive the results (undefined).

This same code works perfectly with 2.1 version, and doesn't work with 2.2, 2.3 .....

I don't know if something important has changed... i haven't noticed anything...

Could you help me with this?

Thanks in advance and best regards,

Ruben
0 Kudos
1 Reply
RubénPérez
Deactivated User
Hello again,

I've already found the problem.

It wasn't about the reception of the results but the format of it.

I don't know why but until now i was receiving an object this way:

[ATTACH=CONFIG]17290[/ATTACH]

but now i'm receiving this
[ATTACH=CONFIG]17291[/ATTACH]

I don't if this is due to changes in API or changes in ArcGIS Server....
0 Kudos