web service call from different computer failed.

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

web service call from different computer failed.

#1

Postby xren » Wed Apr 10, 2013 8:39 pm

Hi,

I have a web service to provide feed to the auto complete field. However, when I test it using browser on the same computer as the server, it works. When I test it with browser on different computer from the server, the auto complete does not work.

I don't know why the web service call will fail when call from different computer.

The other problem with the auto complete is that it will stop working if I didn't use it for a while. Then after I test the web service directly or add an alert in the script it starts to work again.

Can any one help on thsi?
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Thu Apr 11, 2013 9:28 am

Hi,

Are you sure the IP address/domain name and port number are correct for the web service call?

Can you see the web service call coming into the server (check the Ebase logs)?

I am assuming the web service call is to the same machine serving up the web page so the firewall should be OK.

Kind regards

Steve
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#3

Postby Wai » Thu Apr 11, 2013 4:17 pm

Yeah, first thing to check is the URL to the web service (e.g: make sure it is not set as localhost?)
0 x

User avatar
jig
Ebase User
Posts: 30
Joined: Sun Oct 09, 2011 10:16 am
Location: UK

#4

Postby jig » Fri Apr 12, 2013 9:42 am

Hi Xren,

We have implemented auto complete using web service in one of our projects.

The web service that you are accessing must reside on the same domain as the web jQuery script/web-page that is making the request.

There is something called as the 'Same-Origin Policy' which is enforced by all browsers to prevent cross-site scripting.

Some links you may find useful:
1) http://en.wikipedia.org/wiki/Same_origin_policy
2) http://stackoverflow.com/questions/2697 ... oss-domain

I would recommend you to use a tool similar to 'Firebug' (Firefox) and check the 'Net' options which will show you what is exactly being sent and returned from the web service.

If the domain on the web-page/Jquery is different to the web service, the request will not reach the Ebase server.

Hope this helps!

Regards
Jignesh
0 x
Regards,
Jignesh

Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#5

Postby xren » Fri Apr 12, 2013 8:23 pm

You are all correct. The same origin policy is the the reason.

Thank you all,
Xiaoli
0 x


Who is online

Users browsing this forum: No registered users and 22 guests