Il giorno gio, 22/12/2005 alle 18.00 +0100, Davide Romanini ha scritto:

> More on that: I tested my service with Axis 1.2.1, 1.3, 1.4 (from
> nightly builds) and still have the same problem. I still don't
> understand why it can't find the serializer I defined and why it doesn't
> return any fault in response.
> 

Solved!!

The problem seems to be related to how ArraySerializer inspects the
array itself. If my method is like this:

public Code[] list()
{
        return new Code[] { new CodeImpl() };
}

then Axis looks for the Code serializer and NOT for the element
implementation serializer (CodeImpl).

If instead a make

public Code[] list()
{
        return new CodeImpl[] { new CodeImpl() };
}

the interface is still respected BUT now Axis works and loads the
CodeImpl serializer. That means also that Axis DOESN'T  work correctly
if you have inheritance:

public class CodeExtended extends CodeImpl {}

public Code[] list()
{
        return new CodeImpl[] { new CodeImpl(), new CodeExtended() };
}

Axis still uses the CodeImpl serializer for ALL elements inside the
array, so the second element will be accessed using the parent
interface. I really think this is a bug, Axis should load a serializer
based on implementation of the single elements.

Bye,
Davide Romanini 

Reply via email to