Announcement Announcement Module
Collapse
No announcement yet.
retrofitting Axis app with Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 ();
    HttpServlet servlet = (HttpServlet) mctx.getProperty (HTTPConstants.MC_HTTP_SERVLET);
    ServletContext servletContext = servlet.getServletContext ();
    WebApplicationContext webAppContext = WebApplicationContextUtils.getRequiredWebApplicationContext (servletContext);
    Is there a nicer way to configure these Axis end points without a major rewrite?

    Thanks,
    Marius

  • #2
    Your implementation classes should simply extend ServletEndpointSupport.

    Comment


    • #3
      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.

      Comment


      • #4
        Originally posted by davsclaus
        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.
        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.

        Comment

        Working...
        X