Hi!
I am currently developing a .NET 4 C# application which should automate some task in Afaria. I am able to search for devices and so on using the API, but for some reason this does nothing. I do not get an error. It just causes not action in Afaria.
Are there codesamples for tasks like this available anywhere?
Here is my code for this.
AfariaGroups.GroupMemberEntry gmeFrom = new AfariaGroups.GroupMemberEntry();
gmeFrom.GroupId = 0; //group id in afaria
gmeFrom.MemberIdDevice = device[0].DeviceIdInfo.Id;
gmeFrom.MemberIdGroup = 0; //group id in afaria
gmeFrom.GroupMemberName = device[0].AssignmentsUserName;
AfariaGroups.GroupMemberEntry gmeTo = new AfariaGroups.GroupMemberEntry();
gmeTo.GroupId = 11; //group id in afaria
gmeTo.MemberIdDevice = device[0].DeviceIdInfo.Id;
gmeTo.MemberIdGroup = 11; //group id in afaria
gmeTo.GroupMemberName = device[0].AssignmentsUserName;
AfariaGroups.GroupMemberEntry[] gmesTo = new AfariaGroups.GroupMemberEntry[1];
gmesTo[0] = gmeTo;
AfariaGroups.GroupMemberEntry[] gmesFrom = new AfariaGroups.GroupMemberEntry[1];
gmesFrom[0] = gmeFrom;
AfariaGroups.GroupAssignmentRequest asRequestTo = new AfariaGroups.GroupAssignmentRequest();
asRequestTo.RequestType = AfariaGroups.GroupClientAssignmentRequest.Assign;
asRequestTo.GroupClientList = gmesTo;
groupsService.UpdateGroupsAssignments(asRequestTo);
AfariaGroups.GroupAssignmentRequest asRequestFrom = new AfariaGroups.GroupAssignmentRequest();
asRequestFrom.RequestType = AfariaGroups.GroupClientAssignmentRequest.Unassign;
asRequestFrom.GroupClientList = gmesFrom;
groupsService.UpdateGroupsAssignments(asRequestFrom