Bahamut
Bahamut

Reputation: 1939

Soap Ajax cross domain problem

I'm trying to access a SOAP web service on another server using ajax but I'm getting an Access Control Allow Origin error. The web service returns XML so JSONP can't be used and the web service is also being used in another app so modifications is probably the last option. Any solutions?

Upvotes: 4

Views: 5129

Answers (3)

Bahamut
Bahamut

Reputation: 1939

Found the probably most easiest way by using Ajaxpro 2, of course it's meant for .NET. http://www.ajaxpro.info/

otherwise, jfriend00's suggestions are the next best options.

Upvotes: 0

jfriend00
jfriend00

Reputation: 708166

If you can't do JSONP, then your options are:

  1. Craete a server proxy at the domain of the page that can fetch the desired result from the other domain and relay it to you from the allowed domain.
  2. If you're willing to limit your browser support to some modern browsers, then you can investigate Cross Origin Resource Sharing (CORS) which is a "safer" way to do cross-domain requests. You can read about it here.
  3. Cross-domain ajax support via Flash which requires the placement of an appropriate cross-domain policy file on the host of the server you want to access. See here and here for some more info.

Upvotes: 3

Pipalayan Nayak
Pipalayan Nayak

Reputation: 957

You can set up a server proxy at the domain of the page. This page would then call the soap web-service and give you back the response. This page can then be called via ajax from ui.

Upvotes: 1

Related Questions