访问SSIS包中的SharePoint OData feed中的额外信息



我继承了一个SSIS项目,它有40多个独立的包,从各种Sharepoint列表中读取数据。这些连接都是OData feed。提要都是文件列表。我试图访问每个文件的URL,但该信息似乎不在SSIS可以读取的部分提要中。

查看从提要返回的数据时,我只看到了"properties"的子元素中的信息。是否有从提要访问其他信息的方法?特别是内容节点中的"src"

我正在使用VS 2015来编辑包。

这是我正在尝试阅读的提要示例:

<feed 
  xml:base="http://www.sharepointURL.com/consumer/_vti_bin/listdata.svc/" 
  xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" 
  xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" 
  xmlns="http://www.w3.org/2005/Atom">
<title type="text">ConsumerInquiryLibrary</title>
<id>http://www.sharepointURL.com/consumer/_vti_bin/listdata.svc/ConsumerInquiryLibrary</id>
<updated>2016-10-05T19:27:55Z</updated>
<link rel="self" title="ConsumerInquiryLibrary" href="ConsumerInquiryLibrary" />
<entry m:etag="W/&quot;1&quot;">
  <id>http://www.sharepointURL.com/consumer/_vti_bin/listdata.svc/ConsumerInquiryLibrary(3)</id>
  <title type="text"></title>
  <updated>2009-01-26T13:55:24-05:00</updated>
  <author>
    <name />
  </author>
  <link m:etag="&quot;{00000000-0000-0000-0000-000000000000},1&quot;" rel="edit-media" title="ConsumerInquiryLibraryItem" href="ConsumerInquiryLibrary(3)/$value" />
  <link rel="edit" title="ConsumerInquiryLibraryItem" href="ConsumerInquiryLibrary(3)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="ConsumerInquiryLibrary(3)/CreatedBy" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="ConsumerInquiryLibrary(3)/ModifiedBy" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CheckedOutTo" type="application/atom+xml;type=entry" title="CheckedOutTo" href="ConsumerInquiryLibrary(3)/CheckedOutTo" />
  <category term="Microsoft.SharePoint.DataService.ConsumerInquiryLibraryItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <!-- I need access to the URL In the following Node -->
  <content type="application/octetstream" src="http://www.sharepointURL.com/consumer/Consumer%20Inquiry%20Library/DocumentTitle.pdf" />
  <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
  <!-- It appears I only have access to the following elements -->
    <d:Id m:type="Edm.Int32">3</d:Id>
    <d:ContentTypeID>00000000-0000-0000-0000-000000000000</d:ContentTypeID>
    <d:ContentType>Document</d:ContentType>
    <d:Created m:type="Edm.DateTime">2009-01-26T13:55:24</d:Created>
    <d:CreatedById m:type="Edm.Int32">20</d:CreatedById>
    <d:Modified m:type="Edm.DateTime">2009-01-26T13:55:24</d:Modified>
    <d:ModifiedById m:type="Edm.Int32">20</d:ModifiedById>
    <d:CopySource m:null="true"></d:CopySource>
    <d:ApprovalStatus>0</d:ApprovalStatus>
    <d:Path>/xxx/yyy</d:Path>
    <d:CheckedOutToId m:type="Edm.Int32" m:null="true"></d:CheckedOutToId>
    <d:Name>DocumentTitle.pdf</d:Name>
    <d:VirusStatus>42282</d:VirusStatus>
    <d:IsCurrentVersion m:type="Edm.Boolean">true</d:IsCurrentVersion>
    <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
    <d:Version>1.0</d:Version>
    <d:Title m:null="true"></d:Title>
  <!--  End of the elements I can access-->
  </m:properties>
</entry>
</feed>

在完成了项目的许多其他方面之后,我终于回到了这个问题上。

我查看了提要中所有可用的数据,并提出了一个可行的解决方案。

我能够将"Path"属性与站点的基础URL(通过项目参数传递)和"Name"结合使用来构建文件阅读器。

搞定一个包裹,还有44个!

最新更新