Hi, Keith, I just downloaded 0.9.5.3 RC1 (specifically castor-0.9.5.3-xml.jar). The version numbers in all the generated server classes are updated. There were changes in generated classes involving enum constants. But I did not see any change involving xsi:type (in my case the "Record", "RecordDescriptor", "Event", and "EventDescriptor" classes) in the generated classes. It failed with the same reason.
Could the fix be in other jar files? Or do I need to set certain parameters in the castorbuilder.properties file? Thanks, Scott -----Original Message----- From: Keith Visco [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 3:43 PM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] How is schema instance supported in castor framework? Hi Scott, Have you tried 0.9.5.3 RC1? An xsi:type bug affecting root elements was fixed in that release and it may solve the problem you face. Thanks, --Keith "Liu, Scott" wrote: > > Hi, all, > > I am using castor framework in a web service project. I have built a > prototype involving Axis, castor and .NET, which worked pretty well. > Thanks to all, who has contributed to the success of the castor project. > > I have moved from prototyping to the actual project recently and > generated server side code using Castor. But I encountered a problem in > unmarshalling an inherited xml element on the server side when I ran my > application. > > Basically there is a base element with type of "Record" and several > elements with types extending the base type of "Record" (see below for > the schema section). I have a .NET client which marshaled it > successfully as below in the soap request. > > <soap:Body> > <addRequest xmlns="urn:webservices"> > <record xmlns:q1="urn:crm" xsi:type="q1:Event"> > <q1:title>A test event</q1:title> > > <q1:startDate>2004-02-21T01:01:01.008:00</q1:startDate> > </record> > </addRequest> > </soap:Body> > > Notice that the body contains an element "record" with instance type of > "Event". > > The soap request then was posted to the server and I was expecting > Castor would recognize the "record" element with schema instance > "q1:Event" and unmarshal it using "EventDescriptor" class instead of the > "RecordDescriptor" class. Since "Record" descriptor does not have > elements defined in the "event" descriptor and it failed with the > following message as indicated in the soap response. > > <soapenv:Body> > <soapenv:Fault> > <faultcode>soapenv:Server.userException</faultcode> > <faultstring>org.xml.sax.SAXException: Unable to marshall > between XML and Castor Objects :unable to find FieldDescriptor for > 'title' in ClassDescriptor of Record</faultstring> > <detail> > <ns1:stackTrace ................. /> > </detail> > </soapenv:Fault> > </soapenv:Body> > > Can anyone tell me how to solve this inheritance issue in castor > marshalling/unmarshalling process? > > Any hint or suggestion is extremely welcome. > > Thanks, > > Scott > > P.S. the schema involving the base record and the elements inherited > from the it. > > <complexType name="Record" abstract="true"> > <attribute name="key" type="xsd:string"/> > </complexType> > <element name="record" type="dto:Record"/> > > <xsd:element name="Event" type="act:Event"/> > <xsd:complexType name="Event"> > <xsd:complexContent> > <xsd:extension base="dto:Record"> > <xsd:sequence> > <xsd:element name="title" > type="xsd:string"/> > <xsd:element name="startDate" > type="xsd:dateTime" minOccurs="0"/> > </xsd:sequence> > </xsd:extension> > </xsd:complexContent> > </xsd:complexType> > > ----------------------------------------------------------- > 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
