Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-527

Document use of WsdlDefinition when not using MessageDispatcherServlet

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 1.5.8
    • Component/s: Documentation
    • Labels:
      None

      Description

      A lot of the logic for handling publishing of WSDL using WsdlDefinition beans is handled in the MessageDispatcherServlet. In cases where this servlet is not being used, this makes it quite awkward to use the WsdlDefinition stuff.

      Specifically, MessageDispatcherServlet has an explicit bit of code hor dealing with WSDL requests, and it doesn't use the HandlerMapping framework - it intercepts the request before getting that far. When using the vanilla DispatcherServlet (using the guidelines in the ref docs), all requests are routed to the MessageDispatcher, which knows nothing about WSDL requests.

      Can either either provuide an easier mechanism for handling this, or improve the ref docs to demonstrate how to publish WSDL when using DispatcherServlet?

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment - - edited

        Actually, most of the logic for dealing with WSDLs is in the WsdlDefinitionHandlerAdapter , so you need to wire that up. In a plain DispatcherServlet scenario, you can map all *.wsdl requests to the WsdlDefinition beans like so:

        <beans>
         
            <bean class="org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter"/>
            <bean class="org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter"/>
         
            <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                <property name="mappings">
                   <props>
                     <prop key="*.wsdl">myServiceDefinition</prop>
                   </props>
                </property>
                <property name="defaultHandler" ref="messageDispatcher"/>
            </bean>
         
            <bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher"/>
         
            <bean id="myServiceDefinition" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
               <prop name="wsdl" value="/WEB-INF/myServiceDefintion.wsdl"/>
            </bean>
         
        </beans>

        See http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-handlermapping-urlhandlermapping for more info.

        Show
        arjen.poutsma Arjen Poutsma added a comment - - edited Actually, most of the logic for dealing with WSDLs is in the WsdlDefinitionHandlerAdapter , so you need to wire that up. In a plain DispatcherServlet scenario, you can map all *.wsdl requests to the WsdlDefinition beans like so: < beans >   < bean class = "org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter" /> < bean class = "org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter" />   < bean class = "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" > < property name = "mappings" > < props > < prop key = "*.wsdl" >myServiceDefinition</ prop > </ props > </ property > < property name = "defaultHandler" ref = "messageDispatcher" /> </ bean >   < bean id = "messageDispatcher" class = "org.springframework.ws.soap.server.SoapMessageDispatcher" />   < bean id = "myServiceDefinition" class = "org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition" > < prop name = "wsdl" value = "/WEB-INF/myServiceDefintion.wsdl" /> </ bean >   </ beans > See http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-handlermapping-urlhandlermapping for more info.
        Hide
        skaffman Kenny MacLeod added a comment -

        Ah, that's pretty easy, right enough. Perhaps a line or two in the Spring-WS docs?

        Show
        skaffman Kenny MacLeod added a comment - Ah, that's pretty easy, right enough. Perhaps a line or two in the Spring-WS docs?
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        That's a good idea. I'll re-open, and change the title to something more fitting.

        Show
        arjen.poutsma Arjen Poutsma added a comment - That's a good idea. I'll re-open, and change the title to something more fitting.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Added documentation.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Added documentation.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            skaffman Kenny MacLeod
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0d
              0d
              Logged:
              Time Spent - 11m
              11m