Hi, thanks, Keith. The already-built piece used 0.4.3 to create the descriptors and works with it, but not the extension. when i use 0.5.3, I get the exception even earlier: Namely: "unable to find FieldDescriptor for 'SubjectQuery' in ClassDescriptor of RequestType". I'll try now to implement a custom ClassDescriptor Resover.
Chris -- PGP Fingerprint: 633B 47E1 B4AE 6184 2C83 E3DA B800 7BDD 038C 9060 ----- Original Message ----- From: "Keith Visco" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 23, 2004 8:33 PM Subject: Re: [castor-dev] field descriptor not found, searching in wrong class > > > Chris, > > > Christoph Riesenberger wrote: > > > > Is it possible to "say" the unmarshaller which class to map (in java, when > > unmarshalling)? > > For example: "When you find a ...element, take the ...class to unmarshall > > it". > > Yes, you can implement a custom > org.exolab.castor.xml.ClassDescriptorResolver which you can return the > proper descriptor based on XML name + namespace. You can also extend the > default ClassDescriptorResolver > (org.exolab.castor.xml.util.ClassDescriptorResolverImpl). > > For your original problem, did you use Castor 0.9.5.3? It seems strange > that Castor is only looking at the superclass and not the subclass. Was > a descriptor class generated for the subclass? > > Can you open a bug report and attach your test case? > > Thanks, > > --Keith > > > > > > Thanks, > > Chris > > > > -- > > PGP Fingerprint: 633B 47E1 B4AE 6184 2C83 E3DA B800 7BDD 038C 9060 > > ----- Original Message ----- > > From: "Christoph Riesenberger" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, March 22, 2004 5:52 PM > > Subject: [castor-dev] field descriptor not found, searching in wrong class > > > > > > > > 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 > > > > > > > > > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send mail to > > [EMAIL PROTECTED] with a subject of: > > unsubscribe castor-dev > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
