0

I have a web service hosted on a web server, I invoke the web service using jquery ajax.

The service returns results successfully when invoked locally from the server, but it fails when invoked from a remote client machine (not in the same domain).

I see the request fail in the firebug returning error (401 UnAuthorized) and the response has the following error (Request format is unrecognized for URL unexpectedly ending in '/List').

mohamed_assem
  • 123
  • 1
  • 2
  • 9
  • What's the request string? Sounds like there's a server configuration error of some sort, and it's not liking your request. – Marc B Jan 11 '11 at 21:04

2 Answers2

0

Is the page being provided from the same domain as your web service? A cross-domain call will not work on most browsers for security reasons. You can implement an intermediate service at your server to circumvent this.

Raphael
  • 7,972
  • 14
  • 62
  • 83
0

If your client and server are in different domain, it would not be possible to make AJAX call, because of same origin policy issue (http://en.wikipedia.org/wiki/Same_origin_policy).

If your server expose JSON data, you might consider using JSONP in client (http://www.beletsky.net/2010/07/json-jsonp-and-same-origin-policy-issue.html).

Alexander Beletsky
  • 19,453
  • 9
  • 63
  • 86