2

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

com.sun.xml.internal.ws.client.ClientTransportException:服务器在 com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(Unknown Source)
发送 HTTP 状态代码 403:禁止访问 。 sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown Source) at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source) at com.sun。 com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source) 上的 com.sun.xml.internal.ws上的 xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source) 。 com.sun.xml.internal.ws.api.pipe.Fiber._doRun 上的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(Unknown
Source) at
com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at
com.sun.xml.internal.ws.client .sei.SyncMethodHandler.invoke(Unknown
Source) at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source) at 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 Web 服务:

    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 上创建了文件夹。我是否需要该凭据的任何其他权限才能获得访问权限。

4

0 回答 0