You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bill Bug <bb...@speakeasy.org> on 2004/04/10 23:28:23 UTC
automatically merging existing source code with axis-ant generated code
Hi All,
My Axis developing is running at lightning speed now that I've figured
out how to use the various axis-ant tasks to automate the server-side
source, jar & wsdd creation.
I can run 1 or 2 tasks in my ant build file to go from wsdl file, all
the way through to having the service jar added to my
Tomcat/webapps/axis/WEB-INF/lib directory and redeploy the service.
I'm amazed at how easy it is.
There is only one part of the task I need to do by hand. The
<service>Impl.java file obviously needs the service logic inserted into
the 'operation' methods. Nearly all my server-side service
coding/debugging/testing focusses on this core business logic now,
which is how things should be in an ideal world.
I've created a <service>Processor.java file that contains a public
method for each operation provided by my web service. It helps a lot
to have the business logic separated from the Axis auto-generated code.
The operation methods in the <service>Impl.java source need only create
an instance of this 'processor' class, call then simply call the
operation method, sending it the operation input parameters and sending
the return value back from the <service>Impl method. These
<service>Impl methods therefore have only a few lines of code.
Unfortunately, this code needs to be added manually after I execute the
Axis wsdl2Java program to generate the <service>Impl.java.
Is there anyway to automate the insertion of these lines of code into
the <service>Impl.java file as a part of the ant tasks I'm running?
It seems like if I were to use java reflection on the
<service>Impl.java file, I might be able add method code to it, though
that sounds like a lot of work. Does this sound possible and/or is
there an easier way to do it?
Many thanks ahead of time for any assistance you can offer.
Cheers,
Bill
Bill Bug
Senior Analyst/Ontological Engineer
Laboratory for Bioimaging & Anatomical Informatics
Department of Neurobiology & Anatomy
Drexel University College of Medicine
2900 Queen Lane
Philadelphia, PA 19129
215 991 8430 (ph)