I've got an axis2 web-service generated from the WSDL file in a multi module maven project.
wsdl2java
has generated the stubs and basic skeleton for me.
What's the best way to integrate those generated stubs into the exsisting business logic?
I've got several considerations:
- The easiest way is to implement the business logic inside the stub. But I believe that will lead into trouble:
- the stubs now are being generated as part of
mvn clean install
command. Mavenclean
deletes the generated source folder. I will have to protect the stub with the implemented business logic from deletion. - I don't want to commit anything from generated stubs into VCS. I'd like to keep it clean.
- the stubs now are being generated as part of
- There is an option to extend the stub class in another source folder. This eliminates the cons of the previous approach, but brings something new to the stage:
- As I understood from the AXIS2 docs, I have to specify the service class in the
services.xml
(and that's generated with maven-axis2 plugin). So again some parts of the generated stubs should be protected from modification.
- As I understood from the AXIS2 docs, I have to specify the service class in the
Is there a way to somehow avoid this? Something like specifying the service class implementation in the web.xml? or anything similar?
JAX-WS
thanAxis2
, but aren't you just implementing the generated interface insrc/main/java
(either by copying the implementation stub or creating it new) and copying theservices.xml
intosrc/main/resources
(or wherever it's appropriate)? You could set up a Maven profile to turn the generation on and off, if you wanted. – davidfmathesonservices.xml
file every time, as well? I would just copy this tosrc/main/resources/META-INF/services.xml
and edit it to point at an implementation class insrc/main/java
. – davidfmatheson