Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] OpenSAML 2.0 custom data type help

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] OpenSAML 2.0 custom data type help


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: [OpenSAML] OpenSAML 2.0 custom data type help
  • Date: Mon, 09 Feb 2009 16:24:35 -0500



Scott Cantor wrote:


That would be the other option, the one that's actually an xsi:type of your custom type.

I would guess that since AttributeValue is of anyType, you'd have to use the XSAny object set to construct it by itself. Or you'll have to, as Brent said, build a custom class set that handles not only the child element's type but also the type represented by an element with that element as a child.
  

Right, since AttributeValue is defined as an xs:anyType, we don't supply a concrete implementation of AttributeValue.  Any and all XMLObject types could theoretically be used, representing any simple or complex type.  We supply those XS* schema providers for some of the common simple types from XML Schema.  If it's a complex type, you need an XMLObject that implements that type.   If you have a custom type that isn't defined in SAML or any of the other schemas we implement, then obviously we don't supply a provider for that, because we obviously can't.  So you have to supply it.  Either you write one, or you could use an XSAny that supports an open content model of any attribute and any child element.

I would say, though, that if you do have a formal schema and type model, etc, that you probably want to  go ahead and implement providers for them.  At least in my head, that lends itself to more conceptual correctness.  I mean, we could use XSAny for just about everything at a functional level, but we don't.  It's mostly intended to support unmarshalling unknown types that you receive, and provide access to the content model in an open fashion.  It's not really for building and marshalling things in your own code (although it can function that way).

BTW, I've noted that that wiki page OSTwoUsrManJavaAnyTypes is horribly conflating some totally unrelated things, like ur-type xs:anyType vs. <any> wildcards, or is at the very least potentially confusing to someone who doesn't already understand these things in the first place.  And is also outdated, as it still refers to the deprecated ElementProxy class (replaced by XSAny).  I'll probably take a stab at rewriting it in the near future.




Archive powered by MHonArc 2.6.16.

Top of Page