XMLHttpRequest无法加载http://ideone.com/api/1/service.wsdl.Acces
XMLHttpRequest cannot load http://ideone.com/api/1/service.wsdl. Origin null is not allowed by Access-Control-Allow-Origin.
XMLHttpRequest无法加载http://ideone.com/api/1/service.wsdl。Access-Control-Allow-Origin不允许Origin为null
请在这方面帮助我
<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>
我使用jquery和soapproxy (http://code.google.com/p/js-soap-proxy/)。有什么问题吗?我怎样才能消除这个错误?? ?
from murl使用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
你可以在维基百科上找到同源策略信息。绕过它的一种方法是JSONP,但我不认为sonexy使用它。另一种快速找出问题所在的方法是打开firefox的forcecors插件,激活它(视图->工具栏->添加栏),点击cors(屏幕右下角)。如果它是红色的,你可以从任何网站连接到任何网站,因为插件篡改了http响应,使其假装服务器B已经向你发送了cors头(允许其他网站与xmlhttprequests连接到它)。
如果你有访问服务器上的服务,你可以很容易地在服务器上启用cors按照这个网站上的说明:http://enable-cors.org/,他们有每种类型的web服务器的例子
相关文章:
- 如何更改bigquery API中的计费层选项
- Amazon S3 REST API大小不正确
- 客户端服务器REST API captcha实现
- 使用Facebook live API创建实时视频对象时的隐私设置
- 谷歌放置API:按国家或餐馆名称搜索餐馆
- MeteorJS:在带有回调的vzaar api上正确使用wrapAsync
- 是否可以控制获取哪些Google地图脚本(JavaScript API)
- API密钥使用和检查示例
- 测试Angular Service解决错误回调中的promise
- 在同一个服务工作者中处理service-worker.js有任何影响吗
- 谷歌地图API v3不适用于移动浏览器或PhoneGap
- 任何方式使AJAX调用Gmail API,而无需通过JS库
- 谷歌地图JS API+JSON-多个标记没有显示
- Google Elevation Service API 以英尺为单位
- 使用angularjs的service $resource从restful api中检索数据
- Service worker fetch事件不是由Google API请求触发的
- 使用$resource service访问REST API
- XMLHttpRequest无法加载http://ideone.com/api/1/service.wsdl.Acces
- 我该如何使用Service Worker为我所有的API请求添加一个授权头?
- 为什么不是'当使用Google Distance Matrix Service API时,不会调用我的回调函数