SharePoint 2010 createFolder Dws不创建该文件夹

时间:2014-06-23 14:08:54

标签: sharepoint sharepoint-2010

我试图通过通过Web服务(Dws)连接到网站的Java应用程序在SharePoint 2010库中生成文件夹,但我得到ID = 3(NoAccess,这意味着&# 34;用户没有足够的权利",根据文件)作为回报

我的用户有" Total Control"在图书馆。如果我使用Web界面创建文件夹没问题。

我做了这个测试:通过Web界面创建了一个文件夹,然后我通过我的应用程序执行了createFolder。在这种情况下,我收到一条消息,指出该文件夹已经存在,这意味着我会找到正确的" site-library-folderTocreate"。

我现在实际上没有想法,而且我对SharePoint没有太多了解,所以任何帮助都会很棒!

提前致谢。

一个。

其他一些数据:

网站:prueba

图书馆:Repositorio Desarrollo

文件夹:docs

WSDL:http://' localmachine' /prueba/_vti_bin/Dws.asmx?wsdl

端点:http://' localmachine' /prueba/_vti_bin/Dws.asmx

文件夹:Repositorio Desarrollo / docs(已经尝试使用"%20"而不是空格)

对不起,我想我之前应该发布这个:简单版本的代码。

public void create() {
    try {
        DwsSoap dwsSoap = getDwsSoap();
        createFolder(dwsSoap);
    } catch (Exception e) {
        logger.error("Nooooooooooo... : " + e.getMessage());
    }
}

private DwsSoap getDwsSoap() throws Exception {
    URL urlDws = new URL("http://'localmachine'/prueba/_vti_bin/Dws.asmx?wsdl");
    Dws dws = new Dws(urlDws, new QName("http://schemas.microsoft.com/sharepoint/soap/dws/", "Dws"));
    DwsSoap dwsSoap = dws.getDwsSoap();
    BindingProvider bp = (BindingProvider) dwsSoap;
    bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, getProperties().getProperty("username"));
    bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, getProperties().getProperty("password"));
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://'localmachine'/prueba/_vti_bin/Dws.asmx");
    return dwsSoap;
}

private boolean createFolder(DwsSoap p_port) {
    try {
        String result = p_port.createFolder("Repositorio Desarrollo/docs");
        logger.info(result);
        return true;
    } catch (Exception e) {
        logger.error("Some error: " + e.getMessage());
    }

    return false;
}

1 个答案:

答案 0 :(得分:0)

已修复:这是一个许可问题!

用户不仅需要访问库,还需要访问站点。因此,他们创建了一个新网站,用户可以访问创建库并且它可以工作。

希望这对其他人有用。

此致 甲

相关问题