Sharepoint 2013工作流-HttpSend操作无法反序列化JSON数据
基本上,我要做的是为Sharepoint 2013工作流-HttpSend操作无法反序列化JSON数据,json,visual-studio-2012,sharepoint-2013,Json,Visual Studio 2012,Sharepoint 2013,基本上,我要做的是为o365创建工作流(sharepoint2013),它将向文档上传器管理器发送电子邮件 为此,我在VS 2012中创建了自定义活动,它应该返回上传者配置文件,我想从中提取manager登录信息 我正在使用该HttpSend操作和以下REST服务: uri + "_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='" + Login + "'" 响应正常-我已经用fiddler截获了它
o365
创建工作流(sharepoint2013
),它将向文档上传器管理器发送电子邮件
为此,我在VS 2012
中创建了自定义活动,它应该返回上传者配置文件,我想从中提取manager登录信息
我正在使用该HttpSend
操作和以下REST
服务:
uri + "_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='" + Login + "'"
响应正常-我已经用fiddler截获了它,并且我能够用任何JSON解析器对其进行解析(包括将其嵌入fiddler)
我在使用sp designer 2013创建并部署在我的开发环境中的简单工作流中使用了此自定义活动。
但在尝试启动工作流时,工作流被取消,并出现以下错误:
Details: System.IO.InvalidDataException: Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', Received ContentType : 'application/json'. Content (truncated) : '{"d":{"__metadata":{"id":"http://sp13dev/sites/dev/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)","uri":"http://sp13dev [here goes the rest of JSON which is already available above]
因为它是o365的,所以我需要使用声明方式
有人遇到过这样的问题吗?我过去也遇到过类似的问题,并在博客上找到了帮助我解决这个问题的方法
问题的原因是,默认情况下来自SharePoint REST的响应
在XML和SharePoint designer工作流中无法分析XML
需要JSON响应。要解决这个问题,我们需要通过验收
内容类型为application/json;odata=请求头的详细信息。
这样我们将得到JSON响应
尝试上述博客中提到的步骤
Details: System.IO.InvalidDataException: Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', Received ContentType : 'application/json'. Content (truncated) : '{"d":{"__metadata":{"id":"http://sp13dev/sites/dev/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)","uri":"http://sp13dev [here goes the rest of JSON which is already available above]