Skip to Content.
Sympa Menu

mace-opensaml-users - Re: missing namespace attribute

Subject: OpenSAML user discussion

List archive

Re: missing namespace attribute


Chronological Thread 
  • From: "Tom Scavo" <>
  • To: "Scott Cantor" <>
  • Cc: OpenSAML <>
  • Subject: Re: missing namespace attribute
  • Date: Thu, 26 Oct 2006 15:20:51 -0400
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qvFk/1y80roHs5ef1UvxqZykfggsTGx4Jl/Ng7ewXtXq7Xh5bQ+fIQdFqs9gUritHMiPRw0t2dPPyEwG1sHzc51RcO4lPCVzDzmwxpsl2tB1FbsdQG5H8vq5pTTmSkLJPAx7Q1f2srGKwR1/EAwM68kxq1jb79q00J2aZ0A0m+M=

On 10/26/06, Scott Cantor
<>
wrote:
> which is missing a namespace attribute (xmlns:samlsap). If someone
> could tell me what I'm doing wrong, I'd really appreciate it.

You're not adding your namespace to the inclusive prefix list. Using
xsi:type requires the namespace of the QName be manually included when
running c14n code or it will get stripped if it's not visibly used on the
element.

Ah, I see.

If you're application requires custom prefixes, the only thing you can
really do in that version is update the inclusive-prefix property with your
prefix

Yes, I just tried that, and it works great, thanks.

Now I turned it around and tried to consume an assertion containing
such a statement, but the parser chokes:

711 [main] DEBUG org.globus.opensaml11.saml.SAMLSubjectAssertionTest
- Created assertion: <Assertion
xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
AssertionID="cT_S_T-vKMwidT8_Pzkke8UkC68."
IssueInstant="2004-02-25T16:31:03.000Z"
Issuer="http://aaremote.entegrity.com"; MajorVersion="1"
MinorVersion="1"><Conditions NotBefore="2004-02-25T16:26:03.000Z"
NotOnOrAfter="2004-02-25T16:36:03.000Z"></Conditions><SubjectStatement
xmlns:samlsap="urn:oasis:names:tc:SAML:1.1:profiles:assertion:subject"
xsi:type="samlsap:SubjectStatementType"><Subject><NameIdentifier
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName">uid=By-Tor,ou=tobes,dc=hades,dc=com</NameIdentifier></Subject></SubjectStatement></Assertion>
------------- ---------------- ---------------

Testcase: testSubjectStatement took 0.03 sec
Caused an ERROR
SAMLObject.fromStream() caught exception while parsing a stream
(wrapped: cvc-elt.4.2: Cannot resolve 'samlsap:SubjectStatementType'
to a type definition for element 'SubjectStatement'.)
org.xml.sax.SAXParseException: cvc-elt.4.2: Cannot resolve
'samlsap:SubjectStatementType' to a type definition for element
'SubjectStatement'.
at org.globus.opensaml11.saml.SAMLObject.fromStream(Unknown Source)
at org.globus.opensaml11.saml.SAMLSubjectAssertion.<init>(Unknown
Source)
at
org.globus.opensaml11.saml.SAMLSubjectAssertionTest.testSubjectStatement(SAMLSubjectAssertionTest.java:225)
Caused by: org.xml.sax.SAXParseException: cvc-elt.4.2: Cannot resolve
'samlsap:SubjectStatementType' to a type definition for element
'SubjectStatement'.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at
org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
Source)
at
org.apache.xerces.impl.xs.XMLSchemaValidator.getAndCheckXsiType(Unknown
Source)
at
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.globus.opensaml11.saml.XML$ParserPool.parse(Unknown Source)
at org.globus.opensaml11.saml.XML$ParserPool.parse(Unknown Source)
... 18 more

I added the new type to the statement type map in SubjectStatement
(which is not public) but that didn't help:

static {
SAMLStatement.statementTypeMap.put(
new QName(SAMLSAP_NS, "SubjectStatementType"),
SubjectStatement.class.getName());
}

Why isn't the parser resolving this new statement type?

Basically, XML sucks, my old code's pretty broken, and in the best case,
this is really hard and extensions should be considered a last resort.

Understood. If OpenSAML2 makes this safer and easier, I can use that
to push OS2 into Globus at some later date. Until then, we're stuck
with OpenSAML1.

Thanks, Scott. You've already saved me a bunch of time.

Tom



Archive powered by MHonArc 2.6.16.

Top of Page