僅使用文字SOAP調用,是否可以使用RecordsRepository.SubmitFile在Sharepoint網站上的某個位置提交文件?目前我的代碼可以使用Copy.CopyIntoItems將文檔上傳到下拉庫中,並填充所有必要的元數據字段(包括內容類型),但它似乎不想路由到目標庫。在Sharepoint 2010中,是否可以提交現有文件?
我必須重新提交文件作爲字節流才能使用此方法嗎?我將不得不下載文檔,轉換爲base64並重新上傳,這看起來並不理想。
所以現在我試着使用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>
確定,所以如果我給一個文件的字節流和中的現有文件的正確位置,我仍然得到NotFound? –
jambox
2011-03-15 13:32:03
此外,我想知道的主要事情是,我的意思是使用此Web服務提交一個全新的文檔或已經上傳的文檔? – jambox 2011-03-15 13:44:22