在 SSIS 包中使用 OData 源预览 SharePoint 列表时出错

Error previewing SharePoint list with OData source in SSIS package

在 SSIS 包中,我试图从 SharePoint 列表中提取数据。 我正在使用 OData 源连接管理器。我放入了正确的服务文档位置。我正在使用身份验证类型:Windows 身份验证。 当我点击 'Test Connection' 按钮时,我得到 'Test connection succeeded'.

在 OData 源编辑器中,我选择刚刚配置的连接管理器。我选择 'Collection' 选项。然后我从集合中选择列表。 当我点击 'Preview' 按钮时,弹出以下错误:

An error was read from the payload. See the 'Error' property for more details. (Microsoft.Data.OData)

这里是扩展错误:

===================================

An error occured when reading the OData feed. (Microsoft.Data.DataFeedClient)

------------------------------
Program Location:

   at Microsoft.Data.DataFeedClient.DataFeedODataReaderV3.InterceptODataException[T](Func`1 function)
   at Microsoft.Data.DataFeedClient.DataFeedODataReaderV3.ReadNextODataEntry()
   at Microsoft.Data.DataFeedClient.DataFeedODataReaderV3.ReadNextRow(IRow reuseRow)
   at Microsoft.Data.DataFeedClient.BufferedRowsReader.FetchNextRow(IRow reuseRow)
   at Microsoft.Data.DataFeedClient.BufferedRowsReader.MoveNext()
   at Microsoft.Data.DataFeedClient.DataFeedDataReader.InternalMoveNext()
   at Microsoft.Data.DataFeedClient.DataFeedDataReader.Read()
   at Microsoft.DataTransformationServices.DataFlowUI.ODataConnectionPage.PreviewButton_Click(Object sender, EventArgs e)

===================================

An error was read from the payload. See the 'Error' property for more details. (Microsoft.Data.OData)

------------------------------
Program Location:

   at Microsoft.Data.OData.Atom.BufferingXmlReader.ReadNextAndCheckForInStreamError()
   at Microsoft.Data.OData.Atom.BufferingXmlReader.ReadInternal(Boolean ignoreInStreamErrors)
   at Microsoft.Data.OData.Atom.BufferingXmlReader.Read()
   at System.Xml.XmlReader.SkipSubtree()
   at System.Xml.XmlReader.Skip()
   at Microsoft.Data.OData.Atom.ODataAtomEntryAndFeedDeserializer.ReadFeedContent(IODataAtomReaderFeedState feedState, Boolean isExpandedLinkContent)
   at Microsoft.Data.OData.Atom.ODataAtomReader.ReadAtEntryEndImplementation()
   at Microsoft.Data.OData.ODataReaderCore.ReadImplementation()
   at Microsoft.Data.OData.ODataReaderCore.ReadSynchronously()
   at Microsoft.Data.OData.ODataReaderCore.InterceptException[T](Func`1 action)
   at Microsoft.Data.OData.ODataReaderCore.Read()
   at Microsoft.Data.DataFeedClient.DataFeedODataReaderV3.ReadNextODataEntryInternal()
   at Microsoft.Data.DataFeedClient.DataFeedODataReaderV3.<ReadNextODataEntry>b__5()
   at Microsoft.Data.DataFeedClient.DataFeedODataReaderV3.InterceptODataException[T](Func`1 function)

不管我选什么合集,都是一样的错误。我什至尝试使用查询选项将数据限制为 1 个我知道没有问题的字段。

我使用的是 SSDT 2017。SharePoint 版本是 2013。

有什么想法吗?提前致谢。

解决方法

如果您在尝试使用 ODATA 组件连接到 Sharepoint 时遇到问题,您可以使用 SSIS Sharepoint 列表适配器,这是由 Microsoft SSIS 社区(产品团队)完成的一个项目。

这些组件发布在 Codeplex for SSIS 2005 和 2008 上,几年前,该项目被迁移到 GitHub 并更新以支持 SQL Server 2016、2017。

CodePlex 项目URL

GitHub 项目 URL

Sharepoint 列表适配器 2017 版

相关问题


更新 1

在搜索时,我发现了以下关于使用 ODATA 源和 Sharepoint 的主题:

评论中有一位用户 (Ravikiran) 提到了同样的异常,看起来这是一个数据类型问题:

For that i was able to solve it by asking the sharepoint administrator to create a calculated column which would refer to those lookup column and display the value. This calculated column will be of basic type varchar so its easy to pull the data for this through odata adapter.

另外一个用户(Angela)给出了另一个解决方案:

Just to let you know that I got it working. I installed Sharepoint List Adapters which I added it to my SSIS Package