Results 1 to 3 of 3

Thread: How to integrate Spring-WS with existing web-app?

  1. #1

    Question 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. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote 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.

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

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3

    Thumbs up

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •