如何在java中获取sharepoint项目的listItemId值
我正在尝试使用java中sharepoint的ListsSoap web服务来获取当前位于sharepoint上的docx文件的附件。并试图将docx文件下载到我的本地磁盘。然而,现在我在以下代码中尝试从sharepoint获取XML时出错
我明白了 “Microsoft”类型的例外。SharePoint。SoapServer。引发了“SoapServerException”
SharepointReference sharepointReference = new SharepointReference();
ListsSoap listsSoap = sharepointReference.getListAuth("sharepointId","sharepointPassword");
GetAttachmentCollectionResponse.GetAttachmentCollectionResult x = listsSoap.getAttachmentCollection("listName", "28");
参数中的“28”指的是listitems的ows_ID列的值。我不确定这是否是getAttachmentCollection的第二个参数获取的列表项的listItemId
有人知道是因为身份验证问题还是因为listItemId无效而抛出错误吗
# 1 楼答案
如何设置和验证的逻辑在
SharepointReference
类及其getListAuth
方法中被屏蔽。由于不知道逻辑,我们无法确定原因。下面的逻辑是通过web服务访问SharePoint列表内容的典型方法。你可以试试这个这还没有准备好编译,因为我从我的解决方案中借用了一些片段(由于IP原因,我无法共享这些片段)这是我们的垃圾邮件认证者。java类
希望这有帮助