不期望REST API行为如果使用IP地址而不是OnPremise SharePoint的主机名 [英] REST API behavior not expected If uses IP Address instead Host Name for OnPremise SharePoint

查看:103
本文介绍了不期望REST API行为如果使用IP地址而不是OnPremise SharePoint的主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SharePoint 2013 REST API进行集成目的。我有内部部署的SharePoint 2013实例,并且已按照 
如何启用JSON最小值
 设置REST API的JSON接受类型。

以下是我在SharePoint网站中提供的网站结构:

Below is my Sites structure available in my SharePoint site:

TOP级网站  - >  SubSite1 - > SubSite2

TOP Level Site  ->  SubSite1 -> SubSite2

当我尝试使用SharePoint主机名API读取 SubSite1 的子网站时返回预期的响应,但是当我使用IP地址而不是主机名时,API返回自己的网站信息,即SubSite1作为回应而非其子网站。

When I am trying to read subsites of a SubSite1 using SharePoint hostname API return expected response, however when I used IP Address instead of hostname, API returns own site info i.e. SubSite1 in response and not its subsites.

请查看以下回复示例:


  • 使用主机名
GET http://xxx:55000/SubSite1/_api/Web/Webs

Response : 
{
    "odata.metadata": "http://xxx:55000/SubSite1/_api/$metadata#SP.ApiData.Webs",
    "value": [
        {
            "ServerRelativeUrl": "/SubSite1/SubSite2",
            "Title": "SubSite2"
        }
    ]
}


  • 使用IP地址
GET http://xxx:55000/SubSite1/_api/Web/Webs

Response: {
    "odata.metadata": "http://xxx:55000/_api/$metadata#SP.ApiData.Webs",
    "value": [
        {
            "ServerRelativeUrl": "/SubSite1",
            "Title": "SubSite1"
        }
    ]
}

如果您查看代码段2(使用IP地址),当我试图检索SubSite1 API的子网站时,只返回SubSite1信息,而不是它的子网站。

If you look on the snippet 2 (Using IP Address), when I tried to retrieve subsites of SubSite1 API returns SubSite1 information only and not its subsites.

你有任何解决方案或任何指针吗?

Do you have any solution or any pointers on this?

BrajMohan

BrajMohan

推荐答案

您好,

请确认您已在服务器中安装了SharePoint 2013 Service Pack 1和WCF Data Services 5.6。

Please make sure you have installed the Service Pack 1 for SharePoint 2013 and WCF Data Services 5.6 in the server.

并检查是否已为此Web应用程序配置备用访问映射(AAM)。

And check if you have configure the alternate access mappings(AAM) for this web application.

然后使用 Fiddler 来监控请求并查看回复详细信息。 

And then using Fiddler to monitor the request and check the responses detail information. 

最好的问候,

丹尼斯


这篇关于不期望REST API行为如果使用IP地址而不是OnPremise SharePoint的主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆