Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Accessing External REST Service - origin error but test works

Hi

I wonder if you can help me please.

I have set up REST service for my MS SQL database and created all of the rest queries and logins within my Appery.io app.

All of the tests work fine, and I can login and receive a session ID. If I add that session ID to my queries, these work fine as well. So far so good.

But, now I've come to test the app in the browser and I can't get a successful login, despite using the same credentials and service.

Looking at the console in the browser, I am getting the following issue:

XMLHttpRequest cannot load http://mydomainhere:88/rest/user/sess.... The 'Access-Control-Allow-Origin' header has a value 'http://appery.io:88' that is not equal to the supplied origin. Origin 'http://appery.io' is therefore not allowed access.

Any idea how I overcome this please?

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

Accessing External REST Service - origin error but test works

Hello!

Have you tried with Proxy enabled?

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Accessing External REST Service - origin error but test works

Perfect, many thanks!

Nisa Khalid
Posts: 0
Joined: Tue May 05, 2015 1:36 pm

Accessing External REST Service - origin error but test works

hey andy, did you create a column in sql database for session id? may i know ur login table in sql database? how did u do this? i have try so many times for login but it doesn't work?

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Accessing External REST Service - origin error but test works

Hi Nisa,
I got everything working sweet.
The DB is on my server at work so when I get in tomorrow I'll log on and check the table.

Nisa Khalid
Posts: 0
Joined: Tue May 05, 2015 1:36 pm

Accessing External REST Service - origin error but test works

okay thank you andy,i appreciate it :)

Nisa Khalid
Posts: 0
Joined: Tue May 05, 2015 1:36 pm

Accessing External REST Service - origin error but test works

hey andy, did you every try upload image to sql database?

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Accessing External REST Service - origin error but test works

hi Nisa, sorry I didn't get back to you yesterday.
So I didn't have a field for session ID in the SL DB. The dreamfactory service creates this and passes it back to the app via the rest call.
I never had images in the SQL DB either, not something I needed.

Nisa Khalid
Posts: 0
Joined: Tue May 05, 2015 1:36 pm

Accessing External REST Service - origin error but test works

hi andy, how did you pass the data to app? can you screenshot ur login service,the request,response or javascript u did for login ? i'm still new with appery,i really need help

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Accessing External REST Service - origin error but test works

here you go, screenshots of the service :-) Image Image Image Image Image Image

Return to “Issues”