Logic Apps创建Sharepoint文件,但显示错误消息

时间:2019-11-30 21:29:49

标签: azure-logic-apps

在我的逻辑应用程序中,我有一个命令可以在Sharepoint中创建文件。但是,即使它创建了文件,它也会给出此错误消息。当我打印xml(经验证为正确)时,文件输出失败。但是,它成功打印了JSON。这是我用来将JSON转换为XML的表达式

xml(json(outputs('Compose')))

使用此JSON可以创建文件。

{"Results":{"root":[{"PR_ADD1":"","PR_NAME":"JS TEST 
PROPERTY","PR_OWN":"xxx","PR_SNAM":"JS_PROP_1"}, 
{"PR_ADD1":"qqq","PR_NAME":"PROPERTY08","PR_OWN":"SC-CO-001","PR_SNAM":"P- 
 000028"}]}}

尽管XML使用此文本创建了文件,但XML仍然导致创建文件失败。

<Results><root><PR_ADD1>qqq</PR_ADD1><PR_NAME>PROPERTY08</PR_NAME> 
<PR_OWN>SC-CO-001</PR_OWN><PR_SNAM>P-000028</PR_SNAM></root><root><PR_ADD1> 
</PR_ADD1><PR_NAME>JS TEST PROPERTY</PR_NAME><PR_OWN>xxx</PR_OWN> 
<PR_SNAM>JS_PROP_1</PR_SNAM></root></Results>
{
    "statusCode": 500,
    "headers": {
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "Cache-Control": "no-store, private",
        "Date": "Fri, 29 Nov 2019 13:16:30 GMT",
        "Set-Cookie": "ARRAffinity=35d7413135aa4903f68e02da1544fd04b13d5423a37ac45ed3f80796d9d90742;Path=/;HttpOnly;Domain=sharepointonline-ne.azconn-ne.p.azurewebsites.net",
        "Content-Length": "838",
        "Content-Type": "application/json"
    },
    "body": {
        "error": {
            "code": 500,
            "source": "logic-apis-northeurope.azure-apim.net",
            "clientRequestId": "6fb65339-4b52-4c86-9636-9494592404eb",
            "message": "BadGateway",
            "innerError": {
                "status": 500,
                "message": "Type 'Microsoft.Azure.Connectors.SharePoint.ObjectModel.SPBlobMetadataResponse' with data contract name 'SPBlobMetadataResponse:http://schemas.datacontract.org/2004/07/Microsoft.Azure.Connectors.SharePoint.ObjectModel' is not expected. Consider using a DataContractResolver if you are using DataContractSerializer or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to the serializer.",
                "source": "sharepointonline-ne.azconn-ne.p.azurewebsites.net"
            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

我不确定为什么这样做,但我将一个变量设置为等于compose3操作的输出,并将create file action的值设置为此变量。不确定为什么会有所作为,但确实有效。