|
Hi
Ales,
well,
of course, one cannot instantiate an abstract class. But it doesn't matter
if the base class is abstract or not. It comes to the same.
Well,
almost.
My
method in the service:
Message[] getMessages()
{
return {new DefaultMessage(), new
DefaultMessage()};
}
You
will use it with something like Message[] mes = getMessages() and expect
instances of DefaultMessage.
If the
base class is abstract, you will get an array of null members (because the stub
cannot create the base class).
If it
is not, then your array members will be instances of Message, althought the
service returned instances of DefaultMessages.
The
SOAPMonitor shows that service sends the message as expected (instance of
DefaultMessage, with its members).
That's
because the stub doesn't know that there's supposed to be an inheriting class
(see my description below).
It would work, if DefaultMessage did not contain any bean
members.
But
usually it does, and here we come to your exception.
The
stub wants to create an instance of the base class, but get's an unknown
bean member from soap message (because the stub doesn't know
the inheriting class)
My
(not fine but working solution) is to add a dummy method to the service which
makes the stub know the inheriting class:
For
example:
void
dummyMethod(Message message)
{
}
Hope
this helps,
Markus
########################################### |
Title: Abstract classes and inheritance
- AW: Abstract classes and inheritance Knötzinger Markus
- Re: Abstract classes and inheritance Ales St
- AW: Abstract classes and inheritance Knötzinger Markus
