Hello, we use Spring-WS and castor 1.3.1 for unmarshalling and marshalling. Spring-WS provides a class CastorMarshaller to handle the unmarshalling and marshalling for you. We have had to override one method in this class since it does not support adding descriptors to the XMLContext.
So we have a bunch of model objects (as well as the .castor.cdr files) and a bunch of descriptors which are registered with the XMLContext using the addPackage(packageDescriptor) method When we make a call like: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://kirona.com/2009/12/Concept/schema/"> <soapenv:Header/> <soapenv:Body> <sch:LoginRequest> <sch:username>username</sch:username> <sch:password>password</sch:password> </sch:LoginRequest> </soapenv:Body> </soapenv:Envelope> .the request is marshalled fine. If we then make a mistake in the SOAP request e.g. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://kirona.com/2009/12/Concept/schema/"> <soapenv:Header/> <soapenv:Body> <sch:LoginRequest> <sch:usernameWRONG>xxxx</sch:usernameWRONG> <sch:password>xxxxxx</sch:password> </sch:LoginRequest> </soapenv:Body> </soapenv:Envelope> .we get the error (in the SOAP fault respone) "Castor unmarshalling exception: unable to find FieldDescriptor for 'usernameWRONG' in ClassDescriptor of LoginRequest; nested exception is org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor for 'usernameWRONG' in ClassDescriptor of LoginRequest" .which makes sense. However if I repeat the incorrect SOAP request I get...... "Castor unmarshalling exception: The class for the root element 'LoginRequest' could not be found.; nested exception is org.exolab.castor.xml.MarshalException: The class for the root element 'LoginRequest' could not be found." ..it seems to no longer know what the element LoginRequest is anymore?? If I correct the SOAP request it still does not work, I still get the previous error. I can get things to work again by re-structuring the SOAP request as follows (by moving the namespace declaration): <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <sch:LoginRequest xmlns:sch="http://kirona.com/2009/12/Concept/schema/"> <sch:username>username</sch:username> <sch:password>password</sch:password> </sch:LoginRequest> </soapenv:Body> </soapenv:Envelope> .and from this point onwards this is the only way it will work. I know this is a bit SOAP related but it is the marshalling layer that is failing. Any ideas? P

