Skip to Content.
Sympa Menu

mace-opensaml-users - [OpenSAML] Marshalling a SAML Response containing an XACMLAuthzDecisionStatementType

Subject: OpenSAML user discussion

List archive

[OpenSAML] Marshalling a SAML Response containing an XACMLAuthzDecisionStatementType


Chronological Thread 
  • From: Christina Cunningham <>
  • To:
  • Subject: [OpenSAML] Marshalling a SAML Response containing an XACMLAuthzDecisionStatementType
  • Date: Thu, 29 May 2008 16:42:07 +0100

Hi,

When trying to marshall a saml (2.0) response containing an assertion which has an XACMLAuthzDecisionStatement within it's list of statements, I am getting a ClassCastException thrown.

I am assuming that because XACMLAuthzDecisionStatement extends Statement this should be possible to do?

<code>
SAMLObjectBuilder<Response> builder = (SAMLObjectBuilder<Response>) builderFactory
.getBuilder(Response.DEFAULT_ELEMENT_NAME);
Response response = builder.buildObject();
response.setVersion(SAMLVersion.VERSION_20);
Assertion assertion = getAssertion(issueInstant, responseSubject);
XACMLAuthzDecisionStatementType decision = getXACMLAuthzDecisionStatementType();
assertion.getStatements().add(decision); response.getAssertions().add(assertion);

MarshallerFactory marshallerFactory = Configuration.getMarshallerFactory();
Marshaller marshaller = marshallerFactory.getMarshaller(response);
Element subjectElement = marshaller.marshall(response);
</code>

<stacktrace>
java.lang.ClassCastException: org.opensaml.xacml.profile.saml.impl.XACMLAuthzDecisionStatementTypeImpl cannot be cast to org.opensaml.xml.schema.XSAnynull
at org.opensaml.xml.schema.impl.XSAnyMarshaller.marshallAttributes(XSAnyMarshaller.java:39)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallInto(AbstractXMLObjectMarshaller.java:225)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:178)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallChildElements(AbstractXMLObjectMarshaller.java:319)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallInto(AbstractXMLObjectMarshaller.java:227)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:178)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallChildElements(AbstractXMLObjectMarshaller.java:319)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallInto(AbstractXMLObjectMarshaller.java:227)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:133)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:89)
at com.<>.security.saml.SamlResponseHelper.marshallResponseToString(SamlResponseHelper.java:144)
at com.<>.security.saml.SamlResponseHelper.buildResponseString(SamlResponseHelper.java:98)
at com.<>.security.signon.client.TestSamlResponseHelper.<init>(TestSamlResponseHelper.java:50)
at com.<>.security.signon.client.TestSamlResponseHelper.main(TestSamlResponseHelper.java:64)
Exception in thread "main" java.lang.NullPointerException
</stacktrace>


Thanks,

Christina

--
Christina Cunningham
Software Engineer
Belfast eScience Centre (BeSC)
Queen's University, Belfast
e: c.cunningham [at] besc.ac.uk
w: www.besc.ac.uk




Archive powered by MHonArc 2.6.16.

Top of Page