File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes wsgen from Java6 and abstract classes for @WebService? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "wsgen from Java6 and abstract classes for @WebService?" Watch "wsgen from Java6 and abstract classes for @WebService?" New topic

wsgen from Java6 and abstract classes for @WebService?

Christian Meier

Joined: Aug 19, 2009
Posts: 1

I have a project for which I want to write a SOAP web service using Java6 and the following classes.
The main difference to most examples is that I want an abstract class between the Web-API interface and two possible implementations,
a "WsDummy" and a "WsRemote". Using Spring Dependency Injection I want to load exactly one implementation.

The problem now is that "wsgen" complains that all methods from the Interface have to be implemented in
the method specified with the "--sei". It apparently fails to realize that they were implemented in the abstract
"Ws" class because they are common for the "WsDummy" and the "WsRemote". modeler error: Methods in an endpointInterface must be implemented in the implementation class. Interface Class:WsInterface Implementation Class:WsRemote Method: getUserDump(java.lang.String,java.lang.String)

Any ideas for a workaround?

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Have you tried to annotate only WsRemote and WsDummy with the @WebService annotation?
If the inheritance strategy does not work, you could use a delegation strategy; both the WsRemote and WsDummy classes contain a reference to a delegate that implements common behaviour of the two classes (which you now have in the class Ws).
Best wishes!
I agree. Here's the link:
subject: wsgen from Java6 and abstract classes for @WebService?
It's not a secret anymore!