Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] Developing Entensions

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] Developing Entensions


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: [OpenSAML] Developing Entensions
  • Date: Tue, 03 Nov 2009 17:25:41 -0500

Well, the builder has multiple buildObject methods. The object provider
support for extensions is a little atypical - in looking at it we
re-used the same provider for both the metadata and protocol schema
extensions, because the content model is the same. The buildObject()
builds the metadata one. Since you want the protocol schema one, just
use one of the other overloaded buildObject methods, specifying either
the protocol element QName or the triple of namespace, prefix and local
name Strings.

Honestly, we should probably at least have a custom builder for the
protocol Extensions so that people don't have to do that, but that's the
way it is right now.

And btw, you generally don't want to instantiate a builder (or
marshaller or unmarshaller) directly, it's better to obtain it via
Configuration.getBuilderFactory.getBuilder(QName).

--Brent


Deena Gurajala wrote:
> Extensions extens=new ExtensionsBuilder().buildObject();
>
> Is it the correct way to build an extension. Because the prefix is
> coming as md and name space is pointing to Metadata Descriptor schema
> name space.
>
> On Tue, Nov 3, 2009 at 1:15 PM, Brent Putman
> <
> <mailto:>>
> wrote:
>
>
>
> Deena Gurajala wrote:
> > I figured out that I have to write a custom schema for my
> extensions.
> > They way I did it is.
> >
> > -write a custom schema.
>
> Yes, you probably should have a schema for your custom stuff.
>
>
> > - Use JAXB to marshal the JAVA to XML DOM.
> > -Then set it o Extensions using setDOM method.
> >
>
> No, not really. JAXB is not really a complimentary technology to
> OpenSAML. They are both Java-XML binding approaches. Use one or the
> other, but probably not both.
>
>
>
> >
> >
> > Extensions extens=new ExtensionsBuilder().buildObject();
> >
> > extens.setDOM(new
> > DocumentGenerator().generate().getDocumentElement());
>
> No, definitely do not use the setDOM method on the XMLObjects.
> That is
> used by other components withing the library (marshallers and
> unmarshallers) to cache the DOM representation of the XMLObject, it is
> not really intended for use via the public API. You'll get
> unpredictable results doing that.
>
>
>



Archive powered by MHonArc 2.6.16.

Top of Page