org.apache.axis.message.MessageElement[] roleList = roleResp.get_any();
if (roleList.length != 1)
throw new ManifoldCFException("Bad response - expecting one outer 'GetUserCollectionFromGroup' node, saw "+Integer.toString(roleList.length));
MessageElement roles = roleList[0];
if (!roles.getElementName().getLocalName().equals("GetUserCollectionFromGroup"))
throw new ManifoldCFException("Bad response - outer node should have been 'GetUserCollectionFromGroup' node");
Iterator rolesIter = roles.getChildElements();
if (!activeDirectoryAuthority)
{
// We need not only the group itself, but its user children that are Claims-based entities
rval.add("G"+groupName);
while (rolesIter.hasNext())
{
MessageElement child = (MessageElement)rolesIter.next();
if (child.getElementName().getLocalName().equals("Users"))
{
Iterator usersIterator = child.getChildElements();
while (usersIterator.hasNext())
{
MessageElement user = (MessageElement)usersIterator.next();
if (user.getElementName().getLocalName().equals("User"))
{
String isDomainGroup = user.getAttribute("IsDomainGroup");
if (isDomainGroup != null && isDomainGroup.equals("True"))
{
// Add a user token for the domain group
rval.add("U"+user.getAttribute("LoginName"));
}
}
}
}
}
}
else
{
while (rolesIter.hasNext())
{
MessageElement child = (MessageElement)rolesIter.next();
if (child.getElementName().getLocalName().equals("Users"))
{
Iterator usersIterator = child.getChildElements();
while (usersIterator.hasNext())
{
MessageElement user = (MessageElement)usersIterator.next();
if (user.getElementName().getLocalName().equals("User"))
{
rval.add(user.getAttribute("Sid"));
}
}
}
}
}