You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jimi HullegÄrd <ji...@mogul.com> on 2010/12/06 13:49:11 UTC

Generate sources combined with already existing java classes?

Hi,

I am trying to create a simple test webservice client using cxf-codegen-plugin in maven, but I can't get it to work the way I want it to. Since I also has created the server side of the webservice, I already have some classes defined, so I don't want cxf-codegen-plugin to generate them again.

Some background:

-The final web service will be deployed on Weblogic, so I use a weblogic plugin for maven to generate the service for the server side, and I want to avoid manual manipulation of the generated wdsl-file. And I have not been able to make the weblogic plugin set the name attributes on the complexType tags, so all complexTypes are anonymous.

-I want to have as few 3:rd party jar files as possible on both the client- and the server-side. With that I mean that I have no problem using CXF etc when developing and such, but the final product should be as slim as possible.

Now... What I have now is a simple test webservice deployed in Weblogic. Here are the main java classes and configuration involved:

interface Simple:
http://pastebin.com/L1cgvscH

class TestValueObject:
http://pastebin.com/v5bQXSTn

class SimpleImpl:
http://pastebin.com/Z73Aq9ua

wsdl:
http://pastebin.com/hv4BshAP

cxf-codegen-plugin snippet:
http://pastebin.com/HGv9imPv

The interface Simple, together with the class TestValueObject are placed in a separate maven module, that both the service-module and the client-module has as a dependency. But when I build the project and the cxf-codegen-plugin generates the source files, it generates its own Simple interface and TestValueObject class, with the same package name as the real classes and Eclipse detects this and says "The type Simple is already defined", and the same for TestValueObject.

Is there a way to make the cxf-codegen-plugin use my existing classes? All I really want is for it to generate the classes needed for the webservice logic, nothing else. Is there a simple parameter cxf-codegen-plugin missing, or maybe some annotations on the classes?
And I know about the -p parameter, where I can specify another package for the generated classes so they don't collide. But I really would like to use my own classes.

Regards
/Jimi