[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


 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?



 Comments   
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:

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

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 Mon Dec 18 12:52:20 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.