views:

11

answers:

0

I tried using the addGroup() web method from web service from userGroup web service offered by Sharepoint Server.

As stated by MSDN, the following codes were required (using visual studio C# programming platform Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup(); usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials; usrgrpService.AddGroup("Group_Name", "DOMAIN\Owner_Alias", "user", "DOMAIN\User_Alias", "Description");

The following implementation was done: protected String createNewGroup(String groupName){ addShareptGroup.UserGroup userGroup; userGroup = new addShareptGroup.UserGroup(); try { userGroup.Credentials = System.Net.CredentialCache.DefaultCredentials; userGroup.AddGroup(groupName, getUser(), getUser(), getUser(), ""); return "created"; } catch (Exception e) { return e.ToString(); } return "not added"; }

The following exception error was shown:

System.Web.Services.Protocols.SoapException: Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at DocumentLib.addShareptGroup.UserGroup.AddGroup(String groupName, String ownerIdentifier, String ownerType, String defaultUserLoginName, String description) at DocumentLib.DocumentLib.createNewGroup(String groupName)

Hope that you could give some light on it