Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] local part cannot be "null" when creating a QName during unmarshalling an Assertion object

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] local part cannot be "null" when creating a QName during unmarshalling an Assertion object


Chronological Thread 
  • From: Sidhartha Priye <>
  • To:
  • Subject: Re: [OpenSAML] local part cannot be "null" when creating a QName during unmarshalling an Assertion object
  • Date: Mon, 1 Mar 2010 11:21:42 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=U0zUqwdM1iS9wHZ+pwwN1Nz6uLUe50Qo3XCOst3VX6Se0+Qy9tQiQ5rQ3n7urUs4oNHAf+BhpFjvwc42tFvEDFfHSGS21a2+NnpC4JJEfXVBCNnAI4ojjyMeFQHTU3WkqJ3X8xxAIBDimAuZzNx9OWDvGxK0tO7XNRhbQs/v3f0=;

Added some more trace:

[3/1/10 13:26:34:209 EST] 0000001d SystemOut O Starting to
unmarshall DOM element
{}{urn:oasis:names:tc:SAML:2.0:assertion}Assertion
[3/1/10 13:26:34:209 EST] 0000001d SystemOut O Unmarshalling
attributes of DOM Element
{}{urn:oasis:names:tc:SAML:2.0:assertion}Assertion
[3/1/10 13:26:34:209 EST]] 0000001c SystemOut O Name:
ID="_33776a319493ad607b7ab3e689482e45"
[3/1/10 13:26:34:209 EST] 0000001d SystemOut O Node name: ID
[3/1/10 13:26:34:209 EST]] 0000001c SystemOut O local name: null
[3/1/10 13:26:34:209 EST] 0000001d SystemOut O Node
value: _33776a319493ad607b7ab3e689482e45
[3/1/10 13:26:34:209 EST] 0000001d SystemOut O Node type: 2

So it is trying to unmarshall the "ID" attribute of the Assertion Element.
Clearly we can print out the NodeName of the attribute but localname is null.
For that reason XMLHelper.getNodeQName(attribute)) throws the error.

Per the documentation of getLocalNamepublic String getLocalName()
Returns the local part of the qualified name of this node.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes
created with a DOM Level 1 method, such as createElement from the Document
interface, this is always null.
Since:
DOM Level 2

Here is my assertion element for reference.

<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
ID="_33776a319493ad607b7ab3e689482e45"
IssueInstant="2010-03-01T08:01:48.944Z"
Version="2.0"><saml2:Issuer>http://localhost:9088</saml2:Issuer><saml2:Subject><saml2:NameID

Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName">mbrendish</saml2:NameID></saml2:Subject></saml2:Assertion></wsse:Security></soap:Header>

How can I ensure that the attribute has a localname???



thanks
Sid


----- Original Message ----
> From: Scott Cantor
> <>
> To:
>
> Sent: Mon, March 1, 2010 12:43:32 PM
> Subject: RE: [OpenSAML] local part cannot be "null" when creating a QName
> during unmarshalling an Assertion object
>
> > Trace inside the AbstractXMLObjectUnmarshaller.unmarshallAttribute prints
> > this "DatatypeHelper.safeTrimOrNullString(attribute.getNamespaceURI())" to
> > be null. How can I make my code namespace aware, esp when I am parsing
> from
> > a SOAP Header.
>
> The namespace is almost always going to be null. The error says the local
> part (the attribute's name) is null, that's a completely different thing.
>
> -- Scott







Archive powered by MHonArc 2.6.16.

Top of Page