Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

echo override at run time doesnt seem to be working

Hello! When you change echo for REST service please ensure that data you're saving is the same format you specify in service settings (json, xml, jsonp). One more thing - when you do service execute() don't pass in this method empty object as a parameter.

greg keys
Posts: 0
Joined: Wed Sep 25, 2013 4:32 am

echo override at run time doesnt seem to be working

k done, its the activity_user page

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

echo override at run time doesnt seem to be working

Hi Greg,

Is there an error now? How can we reproduce it?

greg keys
Posts: 0
Joined: Wed Sep 25, 2013 4:32 am

echo override at run time doesnt seem to be working

test that app, login with username and password of test
then open your inspect console, click activities the console should say executing service when done click back and click activities again it should say loading cache and not proceed, you can see the error in the console

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

echo override at run time doesnt seem to be working

Hi Greg,

When and what data do you save in localStorage variable "cache_activities"?

I'd advise you to create a Generic service (custom JavaScript implementation) and there output the data you need.
https://getsatisfaction.com/apperyio/... - this may be helpful.

greg keys
Posts: 0
Joined: Wed Sep 25, 2013 4:32 am

echo override at run time doesnt seem to be working

That was originally the plan however when looking at documentation and getsatisfaction answers it seemed like the service echo should have been simpler , which now that we're going on a week of run around has proved to be the opposite.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

echo override at run time doesnt seem to be working

Hi Greg,

Let's try. Do not hesitate to ask us if you have any questions.

greg keys
Posts: 0
Joined: Wed Sep 25, 2013 4:32 am

echo override at run time doesnt seem to be working

ok so the Generic Service worked great thanks for the help.

Kirit Vaghela
Posts: 0
Joined: Tue Aug 27, 2013 11:23 am

echo override at run time doesnt seem to be working

Hello

I'm want to use response as echo for service.

I try following

on PageShow event of page I invoke service.
code
var user =localStorage.getItem('new_user');

Code: Select all

             if ( user == 'true'){ 
                 categories.__requestOptions.echo = ' '; 
                 localStorage.setItem('new_user','false'); 
             } 

             try { 
                 categories.execute({}) 
             } catch (ex) { 
                 console.log(ex.name + '  ' + ex.message); 
                 hideSpinner(); 
             }; 

/code

and on service onSucces I write following code.
code
'onSuccess': function(data) {
categories.__requestOptions.echo = JSON.stringify(data);
},
'onError': function(jqXHR, textStatus, errorThrown) {
alert("Error:can not fetch user projects.");
},
/code

but when I turn off internet and check the service , it show alert "Error:can not fetch user projects" means It's not use echo response when internet is not available.

Please help me.
Thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

echo override at run time doesnt seem to be working

Hello! On error event run:
prealert(categories.requestOptions.echo);/pre
To see what you have in echo service use
precategories.requestOptions.echo = '';/pre instead precategories.__requestOptions.echo = ' ';/pre
there is an empty string insread space

Return to “Issues”