为什么无法从 www.site.com 调用 secure.site.com 上的 .NET ASMX Web 服务?

发布于 2024-09-01 18:50:55 字数 976 浏览 1 评论 0原文

我们在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亢潮 2024-09-08 18:50:55

我记得曾经做过类似的事情。我刚刚制作了一个演示应用程序,并记得必须在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文