Link to home
Start Free TrialLog in
Avatar of xcdev
xcdev

asked on

Sending an abstract argument to a web service

Can I send an abstract argument to a web service ?

Instead of having 2 web service methods
helloWorld(Teacher);
helloWorld(Student);

Can I have:
helloWorld(Person)



When Teacher & Student extend the abstract Person.

Avatar of xcdev
xcdev

ASKER

I failed to note that I got the following exception when trying the above:


Unmarshalling Error: Unable to create an instance of Person





Is there a way to make it work with the abstract class?
Maybe you can make Person and Interface ?
Avatar of xcdev

ASKER

Didn't get your solution.


Can you explain it?
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xcdev

ASKER

I have a slight mistake in my question.

the argument I send isn't ABSTRACT.

It's a regular good class which one of its members is abstract


That sounds strange.
You are probably rather sending an instance of a  class which inherits form abstract class.
Avatar of xcdev

ASKER

After further investigation I am closing this question.

I'll re-post it after I'll figure my problem more accurately.
Same should apply as with my previous comment. Use @XmlSeeAlso to annotate the abstract class