axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Land" <dav...@eurekasoft.com>
Subject Integrating Axis 1.3 and Spring
Date Fri, 01 Aug 2008 16:56:13 GMT
I have a question about integrating Axis 1.3 with Spring. I want to
implement an AOP logging solution for a set of Axis web services.
Basically, I want to be able to do some logging and the beginning and
end of each web service method. My question is regarding how to get Axis
to use an instance of the Spring AOP proxy class.

 

The only solution I could find for doing it was to create a dummy web
service class that inherits from
org.springframework.remoting.jaxrpc.ServletEndpointSupport and then to
override the onInit() method to set a class variable to the AOP object
returned from the Spring application context. Then in each of the dummy
web service's methods, call the corresponding method on the AOP object.
Here is a typical example:

-----------------------------------------------------------------------
public class DummyService extends ServletEndpointSupport implements
IRealWebService {
   private IRealWebService real;

   protected void onInit() {
      this. real =
(IRealWebService)getWebApplicationContext().getBean("wsBean");
   }

   public String sayHello(String message) {
      return real.sayHello(message);
   }

 

   public String doSomethingElse (String message) {
      return real. doSomethingElse (message);
   }
}
-----------------------------------------------------------------------

I'm not a huge fan of this solution because it requires you to keep
around this dummy class that doesn't do anything but create and call the
Spring generated proxy. Then every time you want add a new method to the
web service you would have to go back and update the dummy class as
well. Isn't there a way to get Axis to instantiate and use the AOP proxy
object from the Spring application context? Maybe some lower level
handler in Axis can be overridden so you can inject the Spring object?

 

It's my understanding that Axis2 has better support for Spring, but
using Axis2 is not an option at this point.

 

Thanks,

Dave


Mime
View raw message