Sharepoint Web Services Java-无数据
我在Sharepoint上创建了一些列表。 下一个 我正在尝试使用Java从Sharepoint获取数据:Sharepoint Web Services Java-无数据,java,sharepoint,service,web,Java,Sharepoint,Service,Web,我在Sharepoint上创建了一些列表。 下一个 我正在尝试使用Java从Sharepoint获取数据: ... ListsSoap listsSoap = new Lists().getListsSoap(); GetListCollectionResult getListCollectionResult = listsSoap.getListCollection(); System.out.println(getListCollectionResult.getContent().toStr
...
ListsSoap listsSoap = new Lists().getListsSoap();
GetListCollectionResult getListCollectionResult = listsSoap.getListCollection();
System.out.println(getListCollectionResult.getContent().toString());
...
我的身份验证没有问题,但我的结果始终是一个空列表:
[[Lists: null]]
有什么想法吗
谢谢。事实上,我们必须得到如下的dom响应:
GetListCollectionResult getListCollectionResult = listSoap.getListCollection();
Object result = getListCollectionResult.getContent().get(0);
if(result != null && result instanceof ElementNSImpl)
{
Document document = ((ElementNSImpl)result).getOwnerDocument();
System.out.println(WebServiceUtils.xml(document));
}
xml是一种返回dom的xml字符串表示形式的方法。
最后,我可以看到我的列表集合:
<Lists xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<List AllowDeletion="True" AllowMultiResponses="False" ...
<List AllowDeletion="True" AllowMultiResponses="False" ...
...
我希望这对你有帮助
NodeList list = ((ElementNSImpl)result).getElementsByTagName("List");
...