Par*_*ram 5 web-services sharepoint-2007
我正在尝试使用Copy.asmx webservice,CopyIntoItems方法从本地计算机上载文档.我可以成功上传文档和DateTime属性,但我无法更新文档库的查找属性.我正在使用带有sp2的MOSS 2007
我使用的代码如下所示:
string[] destinationUrls = { Uri.EscapeUriString(destinationUrl) };
CopySharepointService.FieldInformation dateInformation = new CopySharepointService.FieldInformation();
dateInformation.DisplayName = "Date";
dateInformation.Type = CopySharepointService.FieldType.DateTime;
dateInformation.Value = DateTime.Today.ToString();
CopySharepointService.FieldInformation fundInformation = new CopySharepointService.FieldInformation();
fundInformation.DisplayName = "Fund";
fundInformation.Type = CopySharepointService.FieldType.Lookup;
fundInformation.Id = new Guid(fundGuidItem); // This is the GUID of the field being updated in the document library
fundInformation.Value = "1";
CopySharepointService.FieldInformation[] info = { dateInformation, fundInformation };
CopySharepointService.CopyResult[] result;
CopySharepointService.CopySoapClient CopyService2007 = new CopySoapClient("CopySoap");
CopyService2007.ClientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
CopyService2007.CopyIntoItems(destinationUrl, destinationUrls, info, fileData, out result);
Run Code Online (Sandbox Code Playgroud)
文档已成功上载,但查找字段未更新
有人可以帮忙吗?
小智 4
我刚刚找到这个线程:
“不幸的是,CopyIntoItems 不会将信息放入“文件”、“计算”或“查找”类型的字段中。Web 服务使用 SPCopy 类的 CopyIntoItem,它调用一个名为 FieldShouldBeCopiedTo 的私有方法。该方法包含阻止逻辑防止复制查找字段。”
我有时讨厌 SharePoint。