Page 2 of 3
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 4:40 am
by xman
Sure, the reponse tab shows empty with message there is no response.
The other tab is attached.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 5:07 am
by Yurii Orishchuk
Dear xman,
You send us "options" request.
Please find "get/post" request and make screen shot again.
See details:
http://prntscr.com/43hj5t/direct
Also i see on your request there is no x-appery-session-token request parameter.
But it should be.
Please check it out if you realy link this parameter to real value.
Regards.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 5:12 am
by xman
"options" what is that? I have "get" if you see the screen links above.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 5:23 am
by Yurii Orishchuk
Xman,
see on screen shot http://i.imgur.com/hD3yEML.png
OPTIONS sends by browser to server to get information about CORS.
SO you will see here two request 1 - options 2 - get/post
Thus we need to see your 2nd request with "get/post" method.
Regards.
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 5:34 am
by xman
Sure, there is another one there in the Network, and appears it's response tab has the correct response data from the DB. Now I wonder why the response data is showing up "null" when I try to print it out to a label?
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 6:45 am
by xman
Hi Yurii,
I'm still not sure why this is not working, you can see my mappings above in links. The JS that I run upon success of the query/list service is:
var storedFirstName = localStorage.getItem("first_name");
var storedLastName = localStorage.getItem("last_name");
var fullName = storedFirstName + " " + storedLastName;
Apperyio("profile_name_list").text(fullName);
The result I get on the profile_name_list is:
null null
Still stuck 
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 6:48 am
by xman
Here the link that maps response to LSV first_name and last_name. Why am I not getting any data back into these LSV"s?
http://awesomescreenshot.com/04c35vr5d5
They are "null" 
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 6:55 am
by xman
Moreover, when test this same service manually, the response comes back alright:
http://awesomescreenshot.com/0be35vsu47
So, what is making the response return "null" when this same service is executed in the app test?
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 1:07 pm
by Evgene Karachevtsev
Hello,
According to the last two screenshots you have not correct structure of response. Could you please on the test tab of the service press Automatically Create Service Response - this will create the right structure of response. But after this you should remake mapping
Getting 401 Unauthorized error while trying to retrieve user info from DB.
Posted: Thu Jul 17, 2014 2:06 pm
by xman
Hi Evgene,
I get the following error when I try creating from the test tab as you mention:
"Response" area is empty. Please fill it with data and try again.
Could you elaborate what is wrong with the structure I had in those screenshots?