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: Neill Miller <>
  • To:
  • Subject: Re: [OpenSAML] OpenSAML 2.0 custom data type help
  • Date: Mon, 9 Feb 2009 08:26:28 -0600 (CST)

Hello Brent,

Thanks, the prettyPrintXML method looks great. Any ideas on my original
question about the custom data type building into the AttributeValue?

thanks,
-Neill.


----- Original Message -----
From: "Brent Putman"
<>
To:

Sent: Friday, February 6, 2009 3:51:02 PM GMT -06:00 US/Canada Central
Subject: Re: [OpenSAML] OpenSAML 2.0 custom data type help

Note there are several static utility methods in our
org.opensaml.xml.util.XMLHelper class which do this also, once you have a DOM
Node.


Neill Miller wrote:

Hello,

Yes, Scott is correct here. I do the following in Java:

MarshallerFactory marshallerFactory = Configuration.getMarshallerFactory();
Marshaller marshaller = marshallerFactory.getMarshaller(assertion);
Element assertionElem = marshaller.marshall(assertion);

TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();

transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");

StringWriter sWriter = new StringWriter();
StreamResult sResult = new StreamResult(sWriter);
DOMSource domSource = new DOMSource((Node)assertionElem);
transformer.transform(domSource, sResult);
String xml = sWriter.toString();
System.out.println(xml);

Hope that helps,
-Neill.

----- Original Message -----
From: "Scott Cantor"
<>
To:

Sent: Friday, February 6, 2009 12:40:34 PM GMT -06:00 US/Canada Central
Subject: RE: [OpenSAML] OpenSAML 2.0 custom data type help

Nguyen, Thai Q. wrote on 2009-02-06:

Sorry I can't help but I have a question: How do you dump the XML?
I can do it in OpenSAML 1.1 but could not find the way to do it in 2.0. You
marshall the object to a DOM and then serialize the DOM however you want
to, for which there are helper methods also available.

-- Scott



Archive powered by MHonArc 2.6.16.

Top of Page