首页 文章

在Sharepoint 2010中,是否可以提交现有文件?

提问于
浏览
0

仅使用文字SOAP调用,是否可以使用RecordsRepository.SubmitFile在Sharepoint站点上的某个位置提交文件?目前我的代码可以使用Copy.CopyIntoItems将文档上传到dropoff库并填充所有必要的元数据字段,包括内容类型,但它似乎不想路由到目标库 .

我是否必须将文件重新提交为字节流才能使用此方法?我必须下载文件,转换为base64和reupload,这似乎不太理想 .

所以现在我尝试使用RecordsRepository.SubmitFile,但我得到的只是一个NotFound错误 . 我跟着这个example . 我发送的请求如下所示:

<SubmitFile xmlns="http://schemas.microsoft.com/sharepoint/soap/recordsrepository/">
<fileToSubmit />
<properties>
<RecordsRepositoryProperty>
  <Name>ID</Name>
  <Value>120</Value>
  <Type>Counter</Type>
  <Other />
</RecordsRepositoryProperty>
<RecordsRepositoryProperty>
  <Name>ContentTypeId</Name>
  <Value>
  0x010100F61F2571157CF04CA067909F68034A00004471681EEFE6FD4EA87735A0F54C2908</Value>
  <Type>ContentTypeId</Type>
  <Other />
</RecordsRepositoryProperty>
<RecordsRepositoryProperty>
  <Name>ContentType</Name>
  <Value>Routing Documents</Value>
  <Type>Text</Type>
  <Other />
</RecordsRepositoryProperty>
<RecordsRepositoryProperty>
  <Name>Created</Name>
  <Value>3/14/2011 6:18:53 PM</Value>
  <Type>DateTime</Type>
  <Other />
</RecordsRepositoryProperty>
<RecordsRepositoryProperty>
  <Name>vti_modifiedby</Name>
  <Value>ADOMAIN\auser</Value>
  <Type>String</Type>
  <Other />
</RecordsRepositoryProperty>
</properties>
<recordRouting>Routing Documents</recordRouting>
   <sourceUrl>http://site.domain.ad.example.com/sites/mysite/recordc/DropOffLibrary/NM_1_XYZ -  herp derp derp.doc</sourceUrl>
<userName>ADOMAIN\auser</userName>
</SubmitFile>

2 回答

  • 1

    是的,在使用官方文件Web服务时,您必须提供字节流 .

    否则会有点奇怪;例如,它将如何处理不同的身份验证情况 . 此WS也是一种通用方法;内部或外部的任何应用程序都应该能够使用它 .

  • 1

    http://www.sharepointdev.net/sharepoint--development-programming/notfound-error-while-sending-a-document-to-records-center-programmatically-62025.shtml

    FTA:

    有一个名为“记录中心Web服务提交者的记录中心”的组,它基本上指定了允许用户通过Web服务向记录中心提交记录的用户 . 默认情况下,nobody不是该组的成员 . 要添加用户,请转到“记录中心>人员和组>组”,然后单击上面提到的组 . 将用户添加到该组,以上代码有效....

相关问题