Announcement Announcement Module
Collapse
No announcement yet.
How to integrate Spring-WS with existing web-app? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to integrate Spring-WS with existing web-app?

    Hi,

    I have an existing web-app based on Spring MVC. Now i want to expose some of its functionality with Spring-WS as webservice.
    But i'm not sure how to configure my context properly. At the moment i use the same Dispatcher servlet for my web-app and Spring-WS.
    Then i have a single SimpleUrlHandlerMapping that maps both the requests to my web-app controllers and to the SoapMessageDispatcher of Spring-WS.
    The soap part is running fine now even with Acegi integration using Basic Authentication. But after inserting the config for MessageHandlerAdapter into
    my application-servlet.xml the web application stops working and says: No adapter for handler [StartPageController@60e78]: Does your handler implement a supported interface like Controller?
    I did not change anything related to my web app config just the addition of the MessageHandlerAdapter crashes my config.
    What is the best way to configure Spring-WS together with a web-app? Is it a configuration error or have i missed something?

    Thanks in advance and special thx to Arjen: you did a very good job so far!

  • #2
    Originally posted by lasse_stromberg
    I have an existing web-app based on Spring MVC. Now i want to expose some of its functionality with Spring-WS as webservice.
    But i'm not sure how to configure my context properly. At the moment i use the same Dispatcher servlet for my web-app and Spring-WS.
    Then i have a single SimpleUrlHandlerMapping that maps both the requests to my web-app controllers and to the SoapMessageDispatcher of Spring-WS.
    The soap part is running fine now even with Acegi integration using Basic Authentication. But after inserting the config for MessageHandlerAdapter into
    my application-servlet.xml the web application stops working and says: No adapter for handler [StartPageController@60e78]: Does your handler implement a supported interface like Controller?
    I did not change anything related to my web app config just the addition of the MessageHandlerAdapter crashes my config.
    What is the best way to configure Spring-WS together with a web-app? Is it a configuration error or have i missed something?
    That's one of the lesser known features of the DispatcherServlet: if you provide a custom HandlerAdapter (such as the MessageHandlerAdapter), you will lose the standard ones (which are listed in DispatcherServlet.properties). So the solution is to add the SimpleControllerHandlerAdapter to the application-servlet.xml,and everything should work again.

    Originally posted by lasse_stromberg
    Thanks in advance and special thx to Arjen: you did a very good job so far!
    Thanks!

    Comment


    • #3
      Hi Arjen!

      thx for your quick help! After adding the line:
      <bean id="controllerHandlerAdapter" class="org.springframework.web.servlet.mvc.SimpleC ontrollerHandlerAdapter"/>
      to my application-servlet-xml everything works fine!

      Comment

      Working...
      X