OpenSAML - Trouble with XSAnyImpl

Nicolas Peifer nicolaspeifer at gmx.de
Tue Sep 6 16:27:27 BST 2011


Hello,

I have to override the processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) method in an unmarshaller. The unmarshaller is for a SAMLObject that is used in place of an anyType. So, the problem is that when OpenSAML calls the method the parentSAMLObject and childSAMLObject have the type XSAnyType. Consequently the following cast fails with a ClassCastException (XSAnyImpl cannot be cast to CustomOpenSAML.core.AuthnRequestExtension):

public class AuthnRequestExtensionUnmarshaller extends AbstractSAMLObjectUnmarshaller {
	//... version with highlighted syntax: http://paste.kde.org/118837/
@Override
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException {
		//...
	AuthnRequestExtension authnRequestExtension = (AuthnRequestExtension) parentSAMLObject;
		//...

Has anyone an idea why these (parameter) objects are of the type XSAnyType and how can I cast them to the right objects?

Regards,
Nicolas
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the dev mailing list