Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wsgen from Java6 and abstract classes for @WebService?

 
Christian Meier
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

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".

com.sun.tools.ws.processor.modeler.ModelerException: 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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic