【问题标题】:Get '(401)Unauthorized' error when calling SharePoint web service调用 SharePoint Web 服务时出现“(401)Unauthorized”错误
【发布时间】: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


【解决方案1】:

问题是在 IIS 上没有启用基本身份验证。启用基本身份验证后,我可以访问 SharePoint 网络服务。

【讨论】:

    【解决方案2】:

    如果你有 ListsSoap12Stub,试试这个而不是 ListsSoapStub。这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-11
      • 1970-01-01
      • 2016-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多