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: Brent Putman <>
  • To:
  • Subject: Re: [OpenSAML] local part cannot be "null" when creating a QName during unmarshalling an Assertion object
  • Date: Mon, 01 Mar 2010 05:18:20 -0500



On 2/26/2010 8:31 PM, Sidhartha Priye wrote:



[2/26/10 17:16:11:596 EST] 0000001c SystemErr    R  java.lang.IllegalArgumentException: local part cannot be "null" when
creating a QName
[2/26/10 17:16:11:612 EST] 0000001c SystemErr    R      at
javax.xml.namespace.QName.<init>(Unknown Source)
[2/26/10 17:16:11:612 EST] 0000001c SystemErr    R      at
javax.xml.namespace.QName.<init>(Unknown Source)
[2/26/10 17:16:11:612 EST] 0000001c SystemErr    R      at
org.opensaml.xml.util.XMLHelper.constructQName(XMLHelper.java:433)
[2/26/10 17:16:11:612 EST] 0000001c SystemErr    R      at
org.opensaml.xml.util.XMLHelper.getNodeQName(XMLHelper.java:171)
[2/26/10 17:16:11:612 EST] 0000001c SystemErr    R      at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshallAttribute(AbstractXMLObjectUnmarshaller.java:215)



It's failing trying to construct a QName out of an DOM Attr Node.    Either the XML you're sending is malformed in some way, or possibly the way that you parsed the structure into a DOM Element is causing a problem, perhaps it's not namespace-aware or something.  I'd confirm exactly what you are sending from the client by getting a trace of the message, just to be sure.




This is how I am getting the AssertionElement
<code>
      SOAPHeader sh = smc.getMessage().getSOAPHeader();

            // check for wsse:security element under SOAP Header
            Node wsseElement = sh.getFirstChild();

          // check for SAML assertion under wsse:security
element
            Element assertionElement = (Element)
wsseElement.getFirstChild();


Personally, I wouldn't necessarily assume that the first Node under the Security header is your Assertion.  You probably want to specifically check.  Your client might be generating something else in there automatically, like a WSS timestamp or something.  For that matter, it might not even be an Element Node at all, you could have whitespace Text node, etc.  OpenSAML has some helper methods there that you might want to use if you don't want to write your own code for that, like XMLHelper.getChildElementsByTagNameNS(Element root, String namespaceURI, String localName).

--Brent





Archive powered by MHonArc 2.6.16.

Top of Page