You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Frank Schmaus <fr...@web.de> on 2005/05/19 08:23:10 UTC

RE: Axis and Castor - newbie question - Extending org.apache.axis.encoding.ser.castor.Deserializer

Hi there,

first: I have the same problem. I'd need Axis to use Castor serializer 
with mapping file. But I can tell you, with the given Castor-Serializer 
it's not possible, as I made my may through the source of it. But it 
would be easyly extendable. Currently I'm extending it, giving the 
mapping file within the wsdd of the type mapping. This should work.

Now my question: The DEserializer interface is completly different. 
Instead of having one easy method serialize(...) that is doing all (and 
where just the castor marshaller is called), there are a lot of methods 
that seem to be called element by element. The 
org.apache.axis.encoding.ser.castor.Deserializer does not seem to do 
much different then the normal Axis Deserializer and I didn't find any 
place where to provide the castor mapping. And another drawback: I 
didn't find an easy way to provide the mapping-file parameter. The 
Serializer directly get's the parameters from the wsdd file, but I 
couldn't find something like that in the deserializer interface.

Did anyone work already with this things, or was overriding a 
deserializer? Any ideas?

Cheers,
Frank

-----Original Message-----
From: David Easley [mailto:easley@ntlworld.com]
Sent: 1. mai 2005 19:00
To: axis-user@ws.apache.org
Subject: Axis and Castor - newbie question


I've been experimenting using Axis and Castor along the lines described
in the IBM article:
http://www-106.ibm.com/developerworks/webservices/library/ws-castor/
Everything's working fine, but I have a few questions:

1. I want to test that the WS messages are being validated against my
schema (after all, this is one of the main reasons I'm using Castor
rather than plain old WSDL2Java). My test set-up involves using the
Castor generated code on the client and server side, so it's impossible
to generate invalid XML! What's the simplest way to test this?

2. On the server side, I already have a set of DTOs that I must use
internal to the app. So I'm currently having to translate between the
Castor generated objects and my own DTOs, which is a pain. Ideally, I'd
like Castor to unmarshall/marshall directly to/from my DTOs. I've read
the provided Castor XML Mapping documentation but I can't see how to
integrate my Castor XML mapping file into my Axis+Castor solution. Can
this be done?

3. If the answer to 2. is yes, can the incoming WS request messages and
the outgoing WS response messages still be validated against my schema?

If the answer to 2 & 3 is yes, yippeeee!

Thanks for any help,
David