if (object instanceof JAXBElement)
{
JAXBElement<?> element = (JAXBElement<?>) unmarshaller.unmarshal(response);
if (element.getDeclaredType().equals(RequestSecurityTokenResponseCollectionType.class))
{
RequestSecurityTokenResponseCollection collection = new RequestSecurityTokenResponseCollection(
(RequestSecurityTokenResponseCollectionType) element.getValue());
// insert the security token in the parsed response.
if (tokenElement != null)
{
RequestSecurityTokenResponse parsedResponse = collection.getRequestSecurityTokenResponses().get(0);
parsedResponse.getRequestedSecurityToken().setAny(tokenElement);
}
return collection;
}
else