Skip to Content.
Sympa Menu

mace-opensaml-users - Reading a SAML Assertion from a file

Subject: OpenSAML user discussion

List archive

Reading a SAML Assertion from a file


Chronological Thread 
  • From: "Cristian Opincaru" <>
  • To:
  • Subject: Reading a SAML Assertion from a file
  • Date: Tue, 10 Oct 2006 14:42:29 +0200
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=OYZ1hN3+sPK332dRrDrL7Zg4dZ5FVZOyqjtxIOLP11KnfoAi1giWvHJnxt39OP//GXb9f0GolzAxEsg56c61giY72uqL0Uo37S6L1GaCqlzlG17WSocXdcATGsUs8LeRkiUNXtJnL8IS0kE24dKGzqwcgVn5NwlAMa0AQpf2Rmc=


Hi,

I made a program that writes an assertion in a file. Then, from another program I load this assertion and then place it in the header of a SOAP message using WSS4J. The code looks like this:

            Document samlDoc = XMLUtils.newDocument(new InputSource (new FileReader(LICENSE_TOKEN_FILE)));
            // Strangely enough, without clonig the document, I get a NullPointerException, when unmarshalling the assertion
            samlDoc = (Document)samlDoc.cloneNode(true);
            SAMLAssertion licenseToken = new SAMLAssertion(samlDoc.getDocumentElement());           
            WSSAddSAMLToken addSaml = new WSSAddSAMLToken();
            envelope = addSaml.build(envelope, licenseToken);

As I also mentioned in the comment, without cloning the Document I get a NullPointerException when I try to send the message.

Any clue on this strange thing?

Cristian

--
Cristian OPINCARU
University of the Federal Armed Forces Munich
http://www.unibw.de/cristian.opincaru


--
Cristian OPINCARU
University of the Federal Armed Forces Munich
http://www.unibw.de/cristian.opincaru


Archive powered by MHonArc 2.6.16.

Top of Page