com.sun.xml.internal.ws.client.ClientTransportException:服务器发送HTTP状态码403:Forbidden

时间:2015-01-16 06:26:16

标签: java web-services soap sharepoint-2010 httptransportse

使用SharePoint Web服务时出现以下错误:

  

com.sun.xml.internal.ws.client.ClientTransportException:服务器
  发送HTTP状态码403:禁止在   com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(未知   来源)在   com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(未知   来源)在   com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(未知   来源)在   com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(未知   来源)在   com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(未知   来源)com.sun.xml.internal.ws.api.pipe.Fiber .__ doRun(未知)   来源)com.sun.xml.internal.ws.api.pipe.Fiber._doRun(未知)   来源)com.sun.xml.internal.ws.api.pipe.Fiber.doRun(未知
  来源)com.sun.xml.internal.ws.api.pipe.Fiber.runSync(未知)   来源)com.sun.xml.internal.ws.client.Stub.process(未知
  来源)在   com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(未知来源)
    在
  com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(未知
  来源)在   com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(未知
  来自)com.sun.xml.internal.ws.client.sei.SEIStub.invoke(未知   来源)在com.sun.proxy。$ Proxy34.getListItems(未知来源)在   com.jw.sharepoint.examples.SharePointListExample.querySharePointFolder(SharePointListExample.java:67)     在
  com.jw.sharepoint.examples.SharePointListExample.main(SharePointListExample.java:50)

我正在尝试使用以下代码访问SharePoint 2010网络服务:

    public void querySharePointFolder(ListsSoap ls) throws Exception {  
        try
        {
            disableCertificateValidation();
        GetListItems.ViewFields viewFields = null;
        GetListItems.QueryOptions msQueryOptions = new GetListItems.QueryOptions();
        GetListItems.Query msQuery = new GetListItems.Query();
        msQuery.getContent().add(createSharePointCAMLNode(query));
        msQueryOptions.getContent().add(createSharePointCAMLNode(this.queryOptions));
        GetListItemsResponse.GetListItemsResult result = ls.getListItems(
                properties.getProperty("folder"), "", msQuery, viewFields, "",
                msQueryOptions, "");
        writeResult(result.getContent().get(0), System.out);

        Element element = (Element)result.getContent().get(0);
        NodeList nl = element.getElementsByTagName("z:row");
        for(int i = 0; i < nl.getLength(); i++){
            Node node = nl.item(i);
            logger.debug("ID: " + node.getAttributes().getNamedItem("ows_ID").getNodeValue());
            logger.debug("FileRef: " + node.getAttributes().getNamedItem("ows_FileRef").getNodeValue());
        }
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

但它在下一行显示错误:

GetListItemsResponse.GetListItemsResult result = ls.getListItems(
                properties.getProperty("folder"), "", msQuery, viewFields, "",
                msQueryOptions, "");

你可以帮助我解决这个问题,因为在使用不同的方法之后我仍然会遇到同样的问题403:禁止。

我在这里使用相同的凭据,通过它我在SharePoint上创建了文件夹。我是否需要该凭据的任何其他权限才能获得访问权限。

0 个答案:

没有答案
相关问题