Skip to Content.
Sympa Menu

mace-opensaml-users - [OpenSAML] Marshaling an Extension

Subject: OpenSAML user discussion

List archive

[OpenSAML] Marshaling an Extension


Chronological Thread 
  • From: rangeli nepal <>
  • To: "" <>
  • Subject: [OpenSAML] Marshaling an Extension
  • Date: Thu, 19 May 2011 07:52:36 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=DWq42Px1kC2elH6P9+XMsg1TeENKbDNkXK7k45hpEE6UJ5Bk8C8JPF23iBb1xr40o+ EaAC24fkEAEXvsU7QTD5ITACtEusFXBVkVF7na08/7uABAtPJsEInUqnwWdWaA2nG5Sx B4m+CHPsZBkG6hnmTYW0SvNoduQ4WEA+2f0Z0=

Good Morning Everybody,

I have recently written a SAML extension using opensaml. It works nice
and fine. However recently I realized extension that it creates has
md:Extensions not saml2P:Extensions.
I thought default buildObject method ExtensionBuilder is creating
md:Extensions.

I did following:
1)

ExtensionsBuilder extBuilder = new ExtensionsBuilder();

Extensions extensions =
extBuilder.buildObject(SAMLConstants.SAML20_NS, Extensions.LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);

It builds the object but when marshaling it it gives:

java.lang.ClassCastException:
org.opensaml.saml2.common.impl.ExtensionsImpl cannot be cast to
org.opensaml.xml.schema.XSAny

I see my self registering all custom object using

org.opensaml.DefaultBootstrap.bootstrap()
Configuration.registerObjectProvider(.........)

Just to try my another way:

2)
But it does not build extBuilder.

QName extQName = new QName(SAMLConstants.SAML20_NS,
Extensions.LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
ExtensionsBuilder extBuilder =
(ExtensionsBuilder)builderFactory.getBuilder(extQName);
Extensions extensions =
extBuilder.buildObject(SAMLConstants.SAML20_NS, Extensions.LOCAL_NAME,
SAMLConstants.SAML20_PREFIX);

I believe i am missing something based on the fact that everything
runs when I just use default (i.e md:Extension).

Any insight will be highly appreciated.

Thank you.
rn



Archive powered by MHonArc 2.6.16.

Top of Page