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 18:15:08 -0500

Yes, for going the XSAny route, that looks correct to me.


Neill Miller wrote:
> Hello Brent and Scott,
>
> Thanks so much for your patience and assistance. I think I got my code
> working now and everything appears as it should. I ended up building the
> AttributeValue as an XSAny type and adding the instantiation of my custom
> type as a child (as you both had mentioned).
>
> Reference code is included below -- I believe it's doing what you
> specified. Feel free to verify.
>
> --------------------
> // start with the attribute we're building
> Attribute attribute = attributeBuilder.buildObject();
> ...
>
> // instantiate my custom type and set parameters
> XSMyType myTypeValue = myTypeBuilder.buildObject(
> "http://www.myns.org";, "myType", "myns");
> myTypeValue.setParam1("foo");
> myTypeValue.setParam2("bar");
>
> // instantiate the XSAnyBuilder to build my XSAny typed AttributeValue
> XSAnyBuilder xsb = new XSAnyBuilder();
> XSAny myXSAny = xsb.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME);
>
> // add XSMyType built above to this XSAny typed AttributeValue's list of
> children
> myXSAny.getUnknownXMLObjects().add(myTypeValue);
>
> // finally, add the XSAny AttributeValue to the attribute
> attribute.getAttributeValues().add(myXSAny);
> --------------------
>
> Appears to work perfectly!
>
> Thanks again,
> -Neill.
>
> ----- "Brent Putman"
> <>
> wrote:
>
>
>



Archive powered by MHonArc 2.6.16.

Top of Page