[SWS-527] Document use of WsdlDefinition when not using MessageDispatcherServlet Created: 16/Jun/09  Updated: 04/May/12  Resolved: 03/Aug/09

Status: Closed
Project: Spring Web Services
Component/s: Documentation
Affects Version/s: 1.5.7
Fix Version/s: 1.5.8

Type: Improvement Priority: Major
Reporter: Kenny MacLeod Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 11m
Original Estimate: Not Specified


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?

Comment by Arjen Poutsma [ 16/Jun/09 ]

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:


    <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">
             <prop key="*.wsdl">myServiceDefinition</prop>
        <property name="defaultHandler" ref="messageDispatcher"/>

    <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"/>


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

Comment by Kenny MacLeod [ 16/Jun/09 ]

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

Comment by Arjen Poutsma [ 16/Jun/09 ]

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

Comment by Arjen Poutsma [ 03/Aug/09 ]

Added documentation.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Thu Oct 18 01:25:16 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.