【发布时间】:2016-06-24 12:04:30
【问题描述】:
我使用 Axis 1.4 从 http://10.0.0.22/_vti_bin/Lists.asmx 生成 java 类
我使用以下代码访问网络服务:
javax.xml.rpc.Service service = new ListsLocator();
ListsSoapStub stub = SharePointWSDL.newLists(new URL("http://10.0.0.22/_vti_bin/Lists.asmx"), service);
stub.setUsername(username);
stub.setPassword(password);
com.microsoft.schemas.sharepoint.soap.GetListCollectionResponseGetListCollectionResult lcr = stub.getListCollection();
我收到“(401)Unauthorized”错误。
如何使用 Axis 生成的 java 类来访问 SharePoint Web 服务?
【问题讨论】:
-
您使用的帐户是否可以访问该网站?另外,你为什么使用IP地址?
-
使用的帐户可以访问该站点。 SharePoint 安装在本地机器上,所以我使用本地 IP。
标签: java web-services sharepoint axis