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 13:20:46 -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=YbKKKZJBShh/xnMFa/jrUVEWUReuOfGZT/5qAqXQAC6Ybrs2jkYdY2dt/2JwNVxlaFFkhqoWL6sgYnpM5UCyyimzH9WU94SglRGqNbCVo9nYn3/9TgNMkhgC8m0A0qjyxQ63yRRTfXMHp7mungiuT5/q6LyXPhVc+sCjJoYQwsk=;

Thanks Scott,
I am just a little unclear when you say "Whatever is doing XML Parsing is not
using the proper settings". How can I control that. I have the Assertion
Element that I pass into the Unmarshaller(Element) at which point of time I
dont have control how its getting parsed and unmarshalled. To be honest I am
a couple of days old into SAML. So if you can point here with respect to the
code where I am going wrong, that will be more helpful -

Here is all the code that is involved.

DefaultBootstrap.bootstrap();
SOAPHeader sh = smc.getMessage().getSOAPHeader();
// check for wsse:security element under SOAP Header
Node wsseElement = sh.getFirstChild();

if (wsseElement == null ||
!"Security".equals(wsseElement.getLocalName())
|| !WS_SECURITY_URI.equals(wsseElement.getNamespaceURI())) {
throw createSOAPFaultException("Missing or invalid WS-Security
Header",
true);
}

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

if (assertionElement == null
|| !"Assertion".equals(assertionElement.getLocalName())
||
!SAMLConstants.SAML20_NS.equals(assertionElement.getNamespaceURI())) {
throw createSOAPFaultException("Missing or invalid SAML
Assertion", true);
}

Assertion samlAssertion =
(Assertion) unmarshall(assertionElement);
.....................
.....................
protected static XMObject unmarshall(Element samlElem) {
UnmarshallerFactory unmarshallerfactory =
Configuration.getUnmarshallerFactory();
Unmarshaller unmarshaller =
unmarshallerfactory.getUnmarshaller(samlElem);

try {
XMLObject xmlObject = unmarshaller.unmarshall(samlElem);
//Error is being thrown here which is calling the underlying SAML APIs.
out.println("SAML document root element unmarshalled");
return xmlObject;
} catch (UnmarshallingException e) {
out.println("Unable to unmarshall XML DOM"+e);
}
return null;
}






----- Original Message ----
> From: Scott Cantor
> <>
> To:
>
> Sent: Mon, March 1, 2010 4:09:59 PM
> Subject: RE: [OpenSAML] local part cannot be "null" when creating a QName
> during unmarshalling an Assertion object
>
> > Thanks Scott for the great suggestion. However I checked and I am using
> > SAAJ1.2 which is DOM2 compliant. Besides I have the JAXP (xercesImpl-
> > 2.9.1.jar, xalan-2.7.1.jar, xml-apis-2.9.1.jar) that is OpenSAML2.3
> > compatible. That being said, it is a good time to have my libraries
> > verified. Anything that jumps out??
>
> I didn't say your libraries weren't aware, I said your parsing code isn't.
>
> > Also, how do I make this code namespace aware.
> >
> > DefaultBootstrap.bootstrap();
> > // check for SOAP Header
> > SOAPHeader sh = smc.getMessage().getSOAPHeader();
>
> None of that code has anything to do with the bug. Whatever is doing the XML
> parsing is not using the proper settings before doing so.
>
> -- Scott







Archive powered by MHonArc 2.6.16.

Top of Page