通过SPD工作流中的REST创建新子站点时出错 [英] Error creating new subsite via REST in SPD Workflow

查看:134
本文介绍了通过SPD工作流中的REST创建新子站点时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SharePoint Designer工作流,当通过REST调用"/_api/web/webinfos/add"创建新的子网站时,它会间歇性地失败.端点.

I have a SharePoint Designer workflow that is intermittently failing when creating new subsites via REST calls to the "/_api/web/webinfos/add" endpoint.

返回的错误代码是"-2147024811,Microsoft.SharePoint.SPException". -2147024811十进制与十六进制0x80070055相同,即本地设备名称已在使用中".并且找不到与我的用例相关的搜索结果.

The error code being returned is "-2147024811, Microsoft.SharePoint.SPException". -2147024811 decimal is identical to hex 0x80070055 "The local device name is already in use" and I can find no search results relevant to my use case.

更多详细信息:我在位置 https://company.sharepoint.com/site1/Lists/SiteRequests ,用户可以向其中添加项目以请求子站点.必填字段之一是"Practice". (带有四个选项的下拉菜单,即PracticeA,PracticeB,PracticeC和PracticeD)和另一个 必填字段为SolicitationNumber(单行文字).

More details: I have a list at the location https://company.sharepoint.com/site1/Lists/SiteRequests to which users may add items in order to request a subsite. One of the required fields is "Practice" (a drop-down with four choices, PracticeA, PracticeB, PracticeC, PracticeD) and another required field is SolicitationNumber (single line of text).

然后,REST端点将为 https://company.sharepoint.com/site1/--实践-/_ api/web/webinfos/add ,而新创建的网站URL的示例为 https://company.sharepoint.com/site1/PracticeA/MyNewSite-MySolicitationNumber .

The REST endpoint then will be https://company.sharepoint.com/site1/--Practice--/_api/web/webinfos/add and an example of a newly created site URL would be https://company.sharepoint.com/site1/PracticeA/MyNewSite-MySolicitationNumber.

工作流使用此处描述的步骤创建REST调用:

The workflow creates the REST call using the steps described here: https://www.dmcinfo.com/latest-thinking/blog/id/8661/create-site-from-template-using-sharepoint-2013-workflow. To summarize, the REST call is made with dictionary objects being built up with various parameters and the call is made from within an App Step, with the necessary permissions being granted by using the "Workflow can use app permissions" Web-scoped feature.

以下是请求字典对象的示例:

Here is a sample of the request dictionary object:

dctRequest: {
    "parameters": {
        "__metadata": {
            "type": "SP.WebInfoCreationInformation"
        },
        "Url": "TestSite1-abc123",
        "Title": "TestSite1-abc123",
        "Description": null,
        "Language": 1033,
        "WebTemplate": "{C54B95F5-ABB6-46B4-B066-02673F628854}#My Custom Site Template 7_2_2017",
        "UseUniquePermissions": false
    }
}

当呼叫失败时,返回的响应代码为"InternalServerError".响应内容如下:

When the call fails the response code returned is "InternalServerError" and the response content is as follows:

dctResponseContent: {
    "error": {
        "code": "-2147024811, Microsoft.SharePoint.SPException",
        "message": {
            "lang": "en-US",
            "value": ""
        }
    }
}

当我使用jquery从Web部件页面调用相同的端点时,它们不会失败.

When I call the same endpoints from a web part page using jquery they do not fail.

推荐答案

这里有两篇文章供您参考,请按照文章中的步骤创建您的工作流程.

Here are two articles for your reference, please follow the steps in articles to create your workflow.

在SPD 2013工作流中使用REST创建SharePoint网站(SPWeb)

https://sharepointryan.com/2013/09/10/create-a-sharepoint-site-spweb-using-rest-in-spd-2013-workflow/

使用SharePoint Designer在工作流中使用REST创建SharePoint网站

https: //rogereriksen.wordpress.com/2013/05/24/create-a-sharepoint-site-using-rest-in-workflow-with-sharepoint-designer/

最好的问候,

Dennis


这篇关于通过SPD工作流中的REST创建新子站点时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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