开发者

Soap Ajax cross domain problem

开发者 https://www.devze.com 2023-04-05 20:47 出处:网络
I\'m trying to ac开发者_C百科cess 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

I'm trying to ac开发者_C百科cess 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?


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号