Hi,
 Apologies if I am posting this to the wrong mailing list but I believe
the error I might be encountering might be a possible bug and hence am
posting this to the dev list. I am trying to use castor with axis by
specifying CastorSeriliazers/Deserializers provided with axis. However,
I don't use the  CastorSerializer to marshal my objects from the client.
We have a custom XML framework that uses the Marshaller in castor to
marshal client objects. 
I have downloaded the source for castor and built version 0.9.5.3. The
error thrown on the server is : 

- Unable to marshall between XML and Castor Objects :
Error processing dom:unable to find FieldDescriptor for 'IDTypeTest' in
ClassDescriptor of IDTypeTest
org.xml.sax.SAXException: unable to find FieldDescriptor for
'IDTypeTest' in ClassDescriptor of IDTypeTest
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.
java:1793)
        at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.
java:1361)
        at
org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.
java:245)
        at
org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.
java:182)
        at
org.exolab.castor.xml.util.DOMEventProducer.processChildren(DOMEventP
roducer.java:333)
        at
org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.
java:247)
        at
org.exolab.castor.xml.util.DOMEventProducer.process(DOMEventProducer.
java:182)
        at
org.exolab.castor.xml.util.DOMEventProducer.start(DOMEventProducer.ja
va:110)
        at
org.apache.axis.encoding.ser.castor.CastorDeserializer.onEndElement(C
astorDeserializer.java:76)
        at
org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl
.java:505)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseri
alizationContextImpl.java:1053)
        at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:165)
        at
org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:1050)
        at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:196)


I am not using mapping files but generate source files with a batch
srcipt which looks like this :

java -classpath
.;%CLASSPATH%;castor-0.9.5.3-xml.jar;commons-discovery.jar;commons-loggi
ng.jar;xercesImpl.jar org.exolab.castor.builder.SourceGenerator -i
"GRIA-v2-OGRE-data-service.xsd" -package
org.gria.serviceprovider.commontypes.messaging -dest "." -f

I have attached the source files (IDTypeTest and IDTypeTestDescriptor)
with this mail..

The xsd file looks like this :

<xs:schema
targetNamespace="http://www.gria.org/org/gria/serviceprovider/commontype
s/messaging" xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns="http://www.gria.org/org/gria/serviceprovider/commontypes/messagin
g" elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:complexType name="IDTypeTest">
                <xs:sequence>
                        <xs:element name="subjectDistinguishedName"
type="xs:string"/>
                        <xs:element name="issuerDistinguishedName"
type="xs:string"/>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="checkDataReturnType">
                <xs:sequence>
                        <xs:element name="dataSizeBytes"
type="xs:long"/>
                        <xs:element name="writeable" type="xs:boolean"/>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="serviceURIType">
                <xs:annotation>
                        <xs:documentation>describes the URL location and
conversation ID for a service</xs:documentation>
                </xs:annotation>
                <xs:sequence>
                        <xs:element name="URL" type="xs:string"/>
                        <xs:element name="conversationID"
type="xs:string"/>
                </xs:sequence>
        </xs:complexType>
</xs:schema>

I am not sure if this is helpful but I have some debug information
printed out on the client to print out the SOAP message which looks like
this :

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
 <soapenv:Body xmlns:wsu="http://schema.xmlsoap.org/ws/2003/utility";
wsu:Id="soapenv:Body">
  <m:deleteContents
xmlns:m="http://www.gria.org/org/gria/serviceprovider/dataservice/messag
ing">
   <m:in1>8081</m:in1>
   <m:in2>
    <IDTypeTest
xmlns="http://www.gria.org/org/gria/serviceprovider/commontypes/messagin
g">
     <subjectDistinguishedName>dummy subject
name</subjectDistinguishedName>
     <issuerDistinguishedName>dummy issuer
name</issuerDistinguishedName>
    </IDTypeTest>
   </m:in2>
  </m:deleteContents>
 </soapenv:Body>

I have taken the header out of the soap message as it contains a digital
signature ..

I have got the CastorDeserilizer class in the axis package to print out
the dom element before it is parsed by DOMEventProducer and that looks
like :

 **** java type
org.gria.serviceprovider.commontypes.messaging.IDTypeTest - This is the
java object that is being unmarshalled.

 OUTPUTDOM --->>> <ns1:in2
xmlns:ns1="http://www.gria.org/org/gria/serviceprovider/dataservice/mess
aging">
    <IDTypeTest
xmlns="http://www.gria.org/org/gria/serviceprovider/commontypes/messagin
g">
     <subjectDistinguishedName>dummy subject
name</subjectDistinguishedName>
     <issuerDistinguishedName>dummy issuer
name</issuerDistinguishedName>
    </IDTypeTest>
   </ns1:in2>

I cant see what I am doing wrong here..Can someone please look at this
and possibly tell me if I have missed something obvious or if there is a
bug somewhere in castor. I can provide more information like the castor
properties and builder properties I use if it will be useful to fix this
error. Thanks a lot In advance..

Ananth

Ananth Krishna
IT Innovation Centre
2 Venture Road
Chilworth Science Park
Southampton, SO16 7NP, UK

tel:  +44 23 8076 0834
fax: +44 23 8076 0833

mailto:[EMAIL PROTECTED]
http://www.it-innovation.soton.ac.uk 

Attachment: IDTypeTest.java
Description: IDTypeTest.java

Attachment: IDTypeTestDescriptor.java
Description: IDTypeTestDescriptor.java

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

Reply via email to