jquery - 通过 URL 重写重定向到 SharePoint 2010 访问 listdata.svc

标签 jquery json sharepoint-2010 url-rewriting svc

我正在使用 URL 重写规则来访问代理服务器,重写 URL 以访问 Sharepoint 服务器。除了/_vti_bin/listdata.svc 上出现 404 之外,一切正常。我还在应用日志中的代理服务器上收到错误。

日志名称:应用程序

Source: System.ServiceModel 4.0.0.0

Date: 1/3/2013 12:49:20 PM

Event ID: 3

Task Category: WebHost

Level: Error

Keywords: Classic

User: IIS APPPOOL\HrSelfService

Computer: webnet01test.bluebunny.com

Description:

WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/9460241 Exception: System.Web.HttpException (0x80004005): The service '/_vti_bin/listdata.svc' does not exist. ---> System.ServiceModel.EndpointNotFoundException: The service '/_vti_bin/listdata.svc' does not exist. at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)

我正在从共享点列表填充菜单标题...

因此页面将是 domain2.com/pages/default.aspx 并且以下代码将执行并填充页面上的菜单。

感谢您提供的任何帮助。

<br/> $.ajax({ url: "<em>http:</em>//Domain1.com/_vti_bin/listdata.svc/MegaMenuCategories?$orderby=OrderingValue%20asc",

        dataType: 'json',
        crossDomain:true, 
        async: false,
        success: function (data) {
        var menuLength = data.d.results.length;
        for (i=0; i<data.d.results.length; i++){
            var results1 = data.d.results[i].MenuTitle;
            var order = data.d.results[i].OrderingValue;

            if (order == "1")
                addMenuTitle(order, results1);   

            if (order == "2")
                addMenuTitle(order, results1);

            if (order == "3")
                addMenuTitle(order, results1);

            if (order == "4")
                addMenuTitle(order, results1);

            if (order == "5")
                addMenuTitle(order, results1);

            if (order == "6")
                addMenuTitle(order, results1);
        }
        if (menuLength == "5"){
            $("#megaRtCorner").css("left","490px");
            $("#megaMenu").css("width","475px");
        }
       }
    });</code>

最佳答案

我与 Microsoft 合作解决了这个问题,并发现如果您通过 URL 重写代理从 SharePoint 请求 listdata.svc 服务,则该请求将在代理处终止。发生的情况是代理服务器尝试处理请求并显然返回 404。

我们要做的就是删除 IIS 中的处理程序映射,以便服务请求将通过代理流向 SharePoint 服务器。

我们删除了特定 IIS 网站上的 svc-Integrated-4.0。

我们测试了 SharePoint,一切运行良好,现在我们可以通过 URL 重写访问 _vti_bin/listdata.svc。

关于jquery - 通过 URL 重写重定向到 SharePoint 2010 访问 listdata.svc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14079104/

相关文章:

javascript - 想要设置默认显示/隐藏脚本可见

javascript - 饼图 3d json 系列

c# - 解决 Sharepoint 中的 'File specified in the modules section of this template already exists.' 错误

sharepoint - Sharepoint WebPart部署-激活功能错误

c# - 对 Microsoft.SharePoint.dll 的引用

javascript - Vue未加载数据

javascript - 使用jquery读取递归数组

用于查找推文计数的 jquery 插件或例程

javascript - JSONP 和 Google map 方向 API

java - 无法在Java中的SparkSQL中读取文件