持久化 TableEntity 时出现错误请求错误

bad request error when persisting TableEntity

我有一个这样的 TableEntity:

public class TableEntity : TableEntity
{
    public string SomeXml { get; set; }
}

其中包含一个名为 SomeXmL 的 XML 字符串。大多数 TableEntities 都很好,但对于一些我得到:

{"The remote server returned an error: (400) Bad Request."}

产生异常的 TableEntities 之一的 XML 字符串包含 33933 个字符。有限制吗?不确定如何确定异常的原因。可以找到导致异常的一个示例 XML here.

您收到此错误的原因是您尝试插入的数据超出了实体属性允许的最大大小。 The maximum size of an entity attribute is 64KB however because strings in Azure Tables are UTF-16 encoded, maximum size of a String type attribute is 32KB

因为您的 XML 大小超过 32KB,所以您会收到此错误。

当我尝试将您在 table 中共享的样本数据插入我的存储帐户时,我收到以下错误:

{
    "odata.error": {
        "code": "PropertyValueTooLarge",
        "message": {
            "lang": "en-US", 
            "value": "The property value exceeds the maximum allowed size (64KB). If the property value is a string, it is UTF-16 encoded and the maximum number of characters should be 32K or less.\nRequestId:693f46ec-0002-0012-3a5a-cbcb16000000\nTime:2016-06-21T01:14:00.4544620Z"
            }
        }
    }