Back Forum Reply New

retrofitting Axis app with Spring

Hi,

I am adding the Spring framework to an existing application which is also using Axis.

Since I needed Spring beans in some of the Axis end points (*BindingImpl classes) I ended up using code like this:

Code:
MessageContext mctx = MessageContext.getCurrentContext #40;#41;;
fromServlet servlet = #40;fromServlet#41; mctx.getProperty #40;fromConstants.MC_from_SERVLET#41;;
ServletContext servletContext = servlet.getServletContext #40;#41;;
WebApplicationContext webAppContext = WebApplicationContextUtils.getRequiredWebApplicationContext #40;servletContext#41;;
Is there a nicer way to configure these Axis end points without a major rewrite?

Thanks,
Marius

Your implementation classes should simply extend ServletEndpointSupport.

Isn't the BindingImpl classes auto generated by Axis?
If so do you really want to modify auto generated source code?

Yes the ServletEndpointSupport is a good base class to extend. Otherwise you could peek in the spring code to see what ServletEndpointSupport does to get the Spring ApplicationContext.


Originally Posted by davsclausIsn't the BindingImpl classes auto generated by Axis?
If so do you really want to modify auto generated source code?

Yes the ServletEndpointSupport is a good base class to extend. Otherwise you could peek in the spring code to see what ServletEndpointSupport does to get the Spring ApplicationContext.

Yes and no - Axis generates a dummy implementation example BindingImpl class, but that's it. You can (and I think you should) delete it and create your own class with the same name that implements the generated interface. That way it's easy to recreate the whole app, starting from the scratch.
¥
Back Forum Reply New