Hi,

I have the following problem:
I use an already built implementation of SAML, to do an extended "attribute
request". For this, the SAML specifications provide an extension point for
defining new requesttypes, which is named "SubjectQuery". This is the
corresponding piece of the scheme:

<element name="Request" type="samlp:RequestType"/>
        <complexType name="RequestType">
                <complexContent>
                        <extension base="samlp:RequestAbstractType">
                                <choice>
                                        <element ref="samlp:Query"/>
                                        <element ref="samlp:SubjectQuery"/>
                                        <element
ref="samlp:AuthenticationQuery"/>
                                        <element
ref="samlp:AttributeQuery"/>
                                        <element
ref="samlp:AuthorizationDecisionQuery"/>
                                        <element
ref="saml:AssertionIDReference" maxOccurs="unbounded"/>
                                        <element
ref="samlp:AssertionArtifact" maxOccurs="unbounded"/>
                                </choice>
                        </extension>
                </complexContent>
...
<element name="SubjectQuery" type="samlp:SubjectQueryAbstractType"/>
...
<complexType name="SubjectQueryAbstractType" abstract="true">
                <complexContent>
                        <extension base="samlp:QueryAbstractType">
                                <sequence>
                                        <element ref="saml:Subject"/>
                                </sequence>
                        </extension>
                </complexContent>
        </complexType>

I now made an "PersonalDataQuery", which extends "SubjectQuery":

 <element name="PersonalDataQuery" type="samlext:PersonalDataQueryType"/>
        <complexType name="PersonalDataQueryType">
                <complexContent>
                        <extension base="samlp:SubjectQueryAbstractType">
                               <sequence>
                                        <element name="PersonalDataName"
type="string" use="required"/>
                                        <element
name="PersonalDataNamespace" type="string" use="optional"/>
                                        <element name="NeedToContinue"
type="boolean" use="required"/>
                                        <element name="IsAttributeGroup"
type="boolean" use="required"/>
                            </sequence>
                             <attribute name="P3PPolicy" type="string"
user="optional"/>
                        </extension>
                </complexContent>
        </complexType>

I let Castor create the sources, without an error.
Now, in Java, I create a new "Request" Object, and add a new SubjectQuery to
the Request, which is in fact the "PersonalDataQuery" (the extended class).
Marshalling works, the XML looks fine:

...
<samlp:SubjectQuery P3PPolicy="nix da"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:type="samlp:PersonalDataQueryType">
        <saml:Subject>
            <saml:NameIdentifier/>
            <saml:SubjectConfirmation>

<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:artifact-01</saml:Co
nfirmationMethod>
            </saml:SubjectConfirmation>
        </saml:Subject>
        <PersonalDataName xmlns="">Mein Attribut</PersonalDataName>
        <PersonalDataNamespace xmlns="">rie.test</PersonalDataNamespace>
        <NeedToContinue xmlns="">false</NeedToContinue>
        <IsAttributeGroup xmlns="">false</IsAttributeGroup>
    </samlp:SubjectQuery>
</samlp:Request>

When I want to unmarshal the xml (in the same servlet, so the classes and
classdescriptors should be known), I get the following exception:

org.xml.sax.SAXException: unable to find FieldDescriptor for
'PersonalDataName' in ClassDescriptor of SubjectQueryAbstractType


Now, it looks for me, as if Castor wants to find the "PersonalDataName"
element in the class "SubjectQueryType" instead of "PersonalDataQueryType".

Is there a solution for this, or did I misunderstand something?

Thanks,

Chris

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to