【问题标题】:POSTing a Sitefinity module with a classification to the oData web service fails将带有分类的 Sitefinity 模块发布到 oData Web 服务失败
【发布时间】:2016-10-26 18:24:36
【问题描述】:

我在 Sitefinity 中有一个自定义模块,其中一个字段是分类。

我正在尝试使用http://mywebsite.com/api/default/customModule 之类的路由将 JSON 对象发布到 Sitefinity 9 Web 服务

我的 POST 正文如下所示:

{
"Field1": "sample string 1",
"Field2": "sample string 2",
"Field3": "sample string 3",
"Category": [
    "6bd9a66e-0e6e-4255-b628-89b86cde6eae"
]
}

这符合 sfhelp 文档,如果我删除“类别”字段,一切都会正常工作。

目前我收到一个错误 Unable to cast object of type 'System.Collections.Generic.List'1[System.Guid]' to type 'Telerik.OpenAccess.TrackedList'1[System.Guid]'

【问题讨论】:

    标签: web-services odata sitefinity


    【解决方案1】:

    看起来该字段是单一的,例如您只能选择一个类别,因此请求不应发送类别数组:

    {
    
    "Field1": "sample string 1",
    "Field2": "sample string 2",
    "Field3": "sample string 3",
    "Category": "6bd9a66e-0e6e-4255-b628-89b86cde6eae"
    }
    

    【讨论】:

      猜你喜欢
      • 2013-12-06
      • 1970-01-01
      • 2016-01-07
      • 2017-04-08
      • 2011-04-06
      • 2015-07-28
      • 2011-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多