如何使用java webservices删除sharepoint 2010中的用户权限

时间:2016-08-24 13:13:00

标签: java soap sharepoint-2010

我尝试删除sharepoint 2010中组中特定用户的权限,但我收到以下错误:

  

javax.xml.ws.WebServiceException:class com.jw.sharepoint.examples.permissions.GetPermissionCollection没有名称为{http://schemas.microsoft.com/sharepoint/soap/directory/} objectName的属性       在com.sun.xml.ws.client.sei.BodyBuilder $ DocLit。(BodyBuilder.java:202)       在com.sun.xml.ws.client.sei.SEIMethodHandler。(SEIMethodHandler.java:81)       在com.sun.xml.ws.client.sei.SyncMethodHandler。(SyncMethodHandler.java:84)       在com.sun.xml.ws.client.sei.SEIStub。(SEIStub.java:82)       at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:639)       at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:341)       在com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:323)       at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:305)       在javax.xml.ws.Service.getPort(Service.java:119)       在com.jw.sharepoint.examples.permissions.Permissions.getPermissionsSoap(Permissions.java:49)       在com.jw.sharepoint.examples.SharePointBaseExample.getPermissionsSoap(SharePointBaseExample.java:186)       在com.jw.sharepoint.examples.SharePointBaseExample.RemovePermission(SharePointBaseExample.java:253)

以下代码:

private PermissionsSoap getPermissionsSoap() throws Exception {
    URL urlPermission = new URL(getProperties().getProperty("permissions.wsdl"));
    Permissions permissions = new Permissions(urlPermission,new QName("http://schemas.microsoft.com/sharepoint/soap/directory/", "Permissions"));
    PermissionsSoap permissionsSoap = permissions.getPermissionsSoap();
    BindingProvider bp = (BindingProvider) permissionsSoap;
    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, getProperties().getProperty("permissions.endpoint"));
    return permissionsSoap;
}

任何人都可以提供解决方案来解决这个问题吗?

0 个答案:

没有答案