为什么无法从 www.site.com 调用 secure.site.com 上的 .NET ASMX Web 服务?
我们在 https://secure.site.com/service.asmx 上有一个 Web 服务https://secure.site.com/consumer.html 工作正常,
但是当我们尝试时要从 https://www.site.com/consumer.html 使用它,我们可以'不要这样做。收到 403 错误。
我可能与网络服务安全相关(因为不同的子域),但我不知道是什么。 如何使 https://secure.site.com/service.asmx 可从 < a href="https://www.site.com/consumer.html" rel="nofollow noreferrer">https://www.site.com/consumer.html?
更新: 使用 JQuery Ajax 调用 Web 服务。
$.ajax({
type: "POST",
url: "https://secure.site.com/service.asmx/method",
data: {},
dataType: "xml",
success: method_result,
error: AjaxFailed
})
;
谢谢。
We have a web service on https://secure.site.com/service.asmx it works fine from https://secure.site.com/consumer.html
but when we try to use it from https://www.site.com/consumer.html we can't do it. Getting 403 error.
I'ts probably something related to webservice security (because of different subdomains) but I can't figure out what.
How to make https://secure.site.com/service.asmx be accessible from https://www.site.com/consumer.html?
Update:
Calling webserivce using JQuery Ajax.
$.ajax({
type: "POST",
url: "https://secure.site.com/service.asmx/method",
data: {},
dataType: "xml",
success: method_result,
error: AjaxFailed
})
;
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我记得曾经做过类似的事情。我刚刚制作了一个演示应用程序,并记得必须在 javascript 块内的 htlm 页面之一中添加类似以下内容:
document.domain: "*.site.com";或“site.com”;
细节很模糊,这可能是我遇到的另一个问题,但它是继续下去的事情。
I recall working on something like this. I just made a demo app and recall having to add something like the following in one of the htlm pages within a javascript block:
document.domain: "*.site.com"; or "site.com";
details are fuzzy and it maybe for another issues I had, but its something to go on.