Page 1 of 2

Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 9:31 pm
by Francisco Narro

Hi,
Today, when I have built my app, I can see that my services with manual implementation are not working.
Last week all of them were working.

I try to create new ones but none are working.

I see that Appery, now it is not calling them.
Help please.


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 9:34 pm
by maxkatz

Please post the service's code and what exactly doesn't work. When your app runs, Appery.io doesn't call your services. The browser simply invokes your code (the app runs in the browser)


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 9:40 pm
by Francisco Narro

My App is the same that last week but now it isn't working.

I invoke the service in the page event.

I build manually the response map
$
--Detalle
--ID

And I add my JS code in the implementation:
precode
$t.jsGetProyectos1 = $t.createClass(null, {

Code: Select all

 init : function(requestOptions) { 
     this.__requestOptions = $.extend({}, requestOptions); 
 }, 

 process : function(settings) { 
     if (this.__requestOptions.echo) { 
         settings.success(this.__requestOptions.echo); 
     } else { 
         var db = window.openDatabase(dbName, dbVersion, dbName, dbSize); 
         var __Rows = []; 
         console.log("hola"); 
         db.transaction(function(tx) { 
             tx.executeSql('SELECT detalle, ID FROM "Ubicaciones" where tipo = 1 order by detalle', [], function(tx, results) { 
                 var v_len = results.rows.length; 
                 if (v_len > v_limite) {v_len = v_limite;} 
                 for (var i = 0; i < v_len; i++) { 
                     fnLog(results&#46;rows&#46;item(i)['detalle']); 
                     if (results&#46;rows&#46;item(i)['detalle'] == "") { 
                         results&#46;rows&#46;item(i)['detalle'] = '<sin nombre>'; 
                         fnLog("hay que cambiar"); 
                     } 
                     __Rows&#46;push(results&#46;rows&#46;item(i)); 
                 } &#47;&#47; for 

             console&#46;log(JSON&#46;stringify(__Rows)); 
             settings&#46;success(__Rows); 
             settings&#46;complete('success'); 
             }); &#47;&#47; SELECT 
         }); &#47;&#47; Transaction 

     } 
 } 

});

/code/pre


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 9:50 pm
by maxkatz

Can you tell us exactly where the service fails?

Do you get anything here:
console.log(JSON.stringify(__Rows));


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 9:55 pm
by Francisco Narro

the service not fails, simply the app isn't invoking it.
I have put log and alert tags in some points of the code and the app is not calling it.


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 9:57 pm
by maxkatz

Can you tell us where exactly the app stopped working, on service invocation? Does it work if you invoke the service on button click for example?


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 10:08 pm
by Francisco Narro

I have tried, and if I invoke the service from a button. It works fine, but not if I invoke from the page show event.


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 10:13 pm
by maxkatz

Check if the service is actually invoked on page show. Add another event handler to see if it is invoked.


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 10:19 pm
by Francisco Narro

I have deleted the old page shown event and created it again and it not work.
I have created another page shown event that show an alert message and it work fine.


Manual implementation on WebServices not working

Posted: Mon Jan 20, 2014 11:10 pm
by maxkatz

Can you put a break point at the top of the service -- to see if execution goes inside the service?