282
Views
0
Helpful
0
Comments

Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-24-2014 01:34 AM
This document was generated from CDN thread
Created by: Chris Bertrand on 16-03-2010 02:25:27 PM
I am trying to add a exisiting user into a user group.
When calling the updateUserGroup method i get the error "There was an error generating the XML document" it then states
InnerException = {"Value of ItemsElementName mismatches the type of UpdateUserGroupReqAddMembers; you need to set it to ItemsChoiceType6.@addMembers."}
Here is the code i used, i am setting the element name to add members so am confused as to why this is occuring. Using v7
UpdateUserGroupReq userGroup = new UpdateUserGroupReq();
userGroup.ItemElementName = ItemChoiceType62.name;
userGroup.Item = Group;
UpdateUserGroupReqAddMembers reqMems = new UpdateUserGroupReqAddMembers();
userGroup.ItemsElementName =new ItemsChoiceType6[1];
userGroup.ItemsElementName[0] = ItemsChoiceType6.addMembers;
XUserGroupMember mem = new XUserGroupMember();
mem.Item = UserID;
XUserGroupMember[] mems = new XUserGroupMember[1];
mems.SetValue(mem, 0);
reqMems.member = mems;
userGroup.Items = reqMems.member;
axlService.updateUserGroup(userGroup);
Any ideas?
Subject: RE: C# Error when adding Member to UserGroup
Replied by: Chris Bertrand on 17-03-2010 10:24:00 AM
Heres a nice function i made that does this.
public void addUserToGroup(String UserID, String Group)
{
//Do a quick check to see if they exist
GetUserGroupRes res = new GetUserGroupRes();
//Add
UpdateUserGroupReq userGroup = new UpdateUserGroupReq();
userGroup.ItemElementName = ItemChoiceType62.name;
userGroup.Item = Group;
UpdateUserGroupReqAddMembers reqMems = new UpdateUserGroupReqAddMembers();
userGroup.ItemsElementName = new ItemsChoiceType6[4];
userGroup.ItemsElementName[0] = ItemsChoiceType6.addMembers;
XUserGroupMember mem = new XUserGroupMember();
mem.Item = UserID;
XUserGroupMember[] mems = new XUserGroupMember[4];
mems.SetValue(mem, 0);
reqMems.member = mems;
userGroup.Items = new UpdateUserGroupReqAddMembers[4];
userGroup.Items[0] = reqMems;
axlService.updateUserGroup(userGroup);
}
<font size="2">
</font>
Created by: Chris Bertrand on 16-03-2010 02:25:27 PM
I am trying to add a exisiting user into a user group.
When calling the updateUserGroup method i get the error "There was an error generating the XML document" it then states
InnerException = {"Value of ItemsElementName mismatches the type of UpdateUserGroupReqAddMembers; you need to set it to ItemsChoiceType6.@addMembers."}
Here is the code i used, i am setting the element name to add members so am confused as to why this is occuring. Using v7
UpdateUserGroupReq userGroup = new UpdateUserGroupReq();
userGroup.ItemElementName = ItemChoiceType62.name;
userGroup.Item = Group;
UpdateUserGroupReqAddMembers reqMems = new UpdateUserGroupReqAddMembers();
userGroup.ItemsElementName =new ItemsChoiceType6[1];
userGroup.ItemsElementName[0] = ItemsChoiceType6.addMembers;
XUserGroupMember mem = new XUserGroupMember();
mem.Item = UserID;
XUserGroupMember[] mems = new XUserGroupMember[1];
mems.SetValue(mem, 0);
reqMems.member = mems;
userGroup.Items = reqMems.member;
axlService.updateUserGroup(userGroup);
Any ideas?
Subject: RE: C# Error when adding Member to UserGroup
Replied by: Chris Bertrand on 17-03-2010 10:24:00 AM
Heres a nice function i made that does this.
public void addUserToGroup(String UserID, String Group)
{
//Do a quick check to see if they exist
GetUserGroupRes res = new GetUserGroupRes();
//Add
UpdateUserGroupReq userGroup = new UpdateUserGroupReq();
userGroup.ItemElementName = ItemChoiceType62.name;
userGroup.Item = Group;
UpdateUserGroupReqAddMembers reqMems = new UpdateUserGroupReqAddMembers();
userGroup.ItemsElementName = new ItemsChoiceType6[4];
userGroup.ItemsElementName[0] = ItemsChoiceType6.addMembers;
XUserGroupMember mem = new XUserGroupMember();
mem.Item = UserID;
XUserGroupMember[] mems = new XUserGroupMember[4];
mems.SetValue(mem, 0);
reqMems.member = mems;
userGroup.Items = new UpdateUserGroupReqAddMembers[4];
userGroup.Items[0] = reqMems;
axlService.updateUserGroup(userGroup);
}
<font size="2">
</font>
Labels: