You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Yao Li (JIRA)" <xm...@xml.apache.org> on 2006/08/30 21:22:25 UTC

[jira] Commented: (XMLBEANS-210) Cannot handle QNames in attribute values correctly

    [ http://issues.apache.org/jira/browse/XMLBEANS-210?page=comments#action_12431662 ] 
            
Yao Li commented on XMLBEANS-210:
---------------------------------

We are using an open soruce SAML toolkit from Sourceid.org. It use XMLBeans version 1.0.2. After I upgraded it to use XMLBean 2.1.0, the SAML toolkit stop working on Single Sign On. 

After digging around, it appears that the problem with attribute value is QName, and new XMLBean does not handle it well (this bug). When checking the SAML reponses digital signature, it throws Invalid signature.

 

> Cannot handle QNames in attribute values correctly
> --------------------------------------------------
>
>                 Key: XMLBEANS-210
>                 URL: http://issues.apache.org/jira/browse/XMLBEANS-210
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: XmlObject
>         Environment: XMLBeans 2.0.0
>            Reporter: Masahiro Kurosawa
>
> I compiled a XSD file into XMLBeans like this:
> - - -
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>     xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2"
>     elementFormDefault="qualified" attributeFormDefault="unqualified" 
>     targetNamespace="http://docs.oasis-open.org/wsrf/sg-2">
>     <xsd:simpleType name="ContentElementsType">
>         <xsd:list itemType="xsd:QName"/>
>     </xsd:simpleType>
>     <xsd:element name="MembershipContentRule">
>         <xsd:complexType>
>             <xsd:attribute name="ContentElements" 
>                 type="wsrf-sg:ContentElementsType" use="required"/>
>         </xsd:complexType>
>     </xsd:element>
> </xsd:schema>
> - - -
> (This is a quotation from WS-ServiceGroup spec:
> http://docs.oasis-open.org/wsrf/wsrf-ws_service_group-1.2-spec-pr-01.pdf)
> and use compiled XMLBeans classes like this:
> - - -
> // Values of 'ContentElements' attribute of 'MembershipContentRule' element
> XmlQName qname1 = XmlQName.Factory.newInstance();
> XmlQName qname2 = XmlQName.Factory.newInstance();
> qname1.setQNameValue( QName.valueOf( "{http://www.bizgrid.org}first" ) );
> qname2.setQNameValue( QName.valueOf( "{http://www.bizgrid.org}second" ) );
> ArrayList contentElements = new ArrayList();
> contentElements.add( qname1 );
> contentElements.add( qname2 );
> // Construct a 'MembershipContentRule' element
> MembershipContentRuleDocument membershipContentRuleDocument =
>   MembershipContentRuleDocument.Factory.newInstance();
> MembershipContentRuleDocument.MembershipContentRule membershipContentRule =
>   membershipContentRuleDocument.addNewMembershipContentRule();
> 	        
> // Set values of attributes created above
> membershipContentRule.setContentElements( contentElements );
> // Output the XML text of 'MembershipContentRule' element to console 
> System.out.println( membershipContentRuleDocument.xmlText() );
> - - -
> Result of last line is:
> - - -
> <wsrf:MembershipContentRule
>   ContentElements="biz:first biz:second" 
>     xmlns:wsrf="http://docs.oasis-open.org/wsrf/sgw-1"/>
> - - -
> Values of 'ContentElements' attribute of 'MembershipContentRule' element seem be just a set of return value of XmlQName.xmlText() method without consideration of collision of prefixes and namespace URIs seem be lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org