xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

Sure, the reponse tab shows empty with message there is no response.

The other tab is attached. Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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.

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

"options" what is that? I have "get" if you see the screen links above.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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.

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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? Image

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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 :(

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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" :(

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Getting 401 Unauthorized error while trying to retrieve user info from DB.

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?

Return to “Issues”