简体   繁体   English

XMLHttpRequest无法加载http://ideone.com/api/1/service.wsdl。 Access-Control-Allow-Origin不允许使用Origin null。

[英]XMLHttpRequest cannot load http://ideone.com/api/1/service.wsdl. Origin null is not allowed by Access-Control-Allow-Origin.

XMLHttpRequest cannot load http://ideone.com/api/1/service.wsdl . XMLHttpRequest无法加载http://ideone.com/api/1/service.wsdl Origin null is not allowed by Access-Control-Allow-Origin. Access-Control-Allow-Origin不允许使用Origin null。

please help me in this regard 请在这方面帮助我

 <html>
<head>
 <title> Web services </title>

<script type="text/javascript" src="jquery.js">
</script>

<script type="text/javascript" src="soapproxy.js">
</script>


<script type="text/javascript">


testob={user:"harisrinivas",pass:"ideonehari"};

function resultcallback(res, xml, text, proxy) {
            alert(res);
        }
        function failurecallback(res, xml, text, proxy) {
            alert("SayHello() failed");
        }
        function gotproxycallback(proxy, wsdl, text) {
            if (proxy instanceof SOAPProxy) {
               //proxy.SayHello(null, true, resultcallback, failurecallback);
               SOAPProxy.prototype.invoke(test, testob, async, resultcallback, faultcallback);

            } else {
                alert("Proxy not created!");
            }
        }
        $(document).ready(function () {
            try {
                SOAPProxyFabric.fromUrl("http://ideone.com/api/1/service.wsdl", true, gotproxycallback);
            } catch (x) {
                alert("Failed to load or parse WSDL!");
            }
        });
</script>

</head>


<body>

<h1> Web service testing by Hari Srinivas </h1>



</body>

</html>

i'm using jquery and soapproxy ( http://code.google.com/p/js-soap-proxy/ ). 我正在使用jquery和soapproxy( http://code.google.com/p/js-soap-proxy/ )。 What is the problem ? 问题是什么 ? and how can i remove this error..?? 以及如何删除此错误。

I guess soapproxy fromurl uses xmlhttprequest, a page from website A is not allowed to make a request to website B. where: 我猜soapproxy fromurl使用xmlhttprequest,不允许网站A的页面向网站B发出请求。其中:

A = google.com 
B = yahoo.com 
or 
A = mysite:80.com 
B = mysite:90.com 
or 
A = subdomain.mysite.com 
B = othersub.mysite.com

You can find same origin policy information on wikipedia. 您可以在Wikipedia上找到相同的原产地政策信息。 A way to go around it is JSONP but I don't think soapproxy uses it. 解决该问题的方法是JSONP,但我不认为soapproxy使用它。 Another way to quickly find out if this is your problem is get the forcecors plugin for firefox, activate it (view -> toolbars -> add on bar) click on cors (right bottom of the screen). 快速查找是否是您的问题的另一种方法是获取firefox的forcecors插件,将其激活(查看->工具栏->添加在栏上),然后单击cors(在屏幕的右下角)。 If it's red you can connect from any site to any site because the plugin fiddles with the http response making it pretend that server B has send you the cors header (allowing other websites to connect to it with xmlhttprequests). 如果为红色,则可以从任何站点连接到任何站点,因为该插件摆弄着http响应,从而使服务器B假装向您发送了cors标头(允许其他网站通过xmlhttprequests连接到它)。

如果您可以访问具有该服务的服务器,则可以按照以下网站上的说明轻松在服务器上启用cors: http ://enable-cors.org/,其中提供了每种类型的Web服务器的示例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 XMLHttpRequest无法加载http:// localhost:8081 / sample.xml。 Access-Control-Allow-Origin不允许使用null。 - XMLHttpRequest cannot load http://localhost:8081/sample.xml. Origin null is not allowed by Access-Control-Allow-Origin. XMLHttpRequest无法加载“此URL”来源Access:Control-Allow-Origin不允许使用原始http:// localhost:3000。 - XMLHttpRequest cannot load “THIS URL” Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin. XMLHttpRequest无法加载http:// localhost:8089 / jquery。 Access-Control-Allow-Origin不允许使用原点null - XMLHttpRequest cannot load http://localhost:8089/jquery. Origin null is not allowed by Access-Control-Allow-Origin Access-Control-Allow-Origin不允许使用Origin null。 - Origin null is not allowed by Access-Control-Allow-Origin. Access-Control-Allow-Origin不允许起源。 - Origin is not allowed by Access-Control-Allow-Origin. “Access-Control-Allow-Origin不允许使用Origin null。”使用jQuery调用Web服务时出错 - “Origin null is not allowed by Access-Control-Allow-Origin.” Error when calling a web service with jQuery XMLHttpRequest无法加载Access-Control-Allow-Origin不允许使用Origin - XMLHttpRequest cannot load Origin is not allowed by Access-Control-Allow-Origin jQuery使用WCF。 错误:XMLHttpRequest无法加载Access-Control-Allow-Origin不允许使用Origin null - Jquery to consume WCF. error: XMLHttpRequest cannot load Origin null is not allowed by Access-Control-Allow-Origin XMLHttpRequest无法加载url Access-Control-Allow-Origin不允许使用Origin null - XMLHttpRequest cannot load the url Origin null is not allowed by Access-Control-Allow-Origin XMLHttpRequest 无法加载 Origin null 不允许 Access-Control-Allow-Origin - XMLHttpRequest cannot load Origin null is not allowed by Access-Control-Allow-Origin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM