[SWS-840] I can't set transformSchemaLocation attribute in MessageDispatcherServlet class through web.xml file Created: 17/Jul/13  Updated: 19/Aug/13  Resolved: 19/Aug/13

Status: Resolved
Project: Spring Web Services
Component/s: Core, XML
Affects Version/s: 2.1.3
Fix Version/s: 2.1.4

Type: Bug Priority: Minor
Reporter: Thiago Gutenberg Carvalho da Costa Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


In my Spring XML file I have a static-wsdl defined and in the WSDL I imported a XML Schema Definition with namespace and schemaLocation attributes.

When I deploy my Web Application I want to the

 <soap:address location /> 


 <xs:import schemaLocation /> 

in WSDL to be transformed to reflect the URI of the incoming HttpServletRequest.

So to achieve this behavior in the web.xml file I have this configuration:


The problem:

When the application is deployed, the method 'initWsdlDefinitionHandlerAdapter' in class 'MessageDispatcherServlet' runs, but only the attribute


in class 'WsdlDefinitionHandlerAdapter' is properly setted with the value passed through the

<init-param />

tag in the web.xml file, and the attribute


is not. As can be seen in red in the code below:

private void initWsdlDefinitionHandlerAdapter(ApplicationContext context) {
   try {
      try {
         wsdlDefinitionHandlerAdapter = context.getBean(getWsdlDefinitionHandlerAdapterBeanName(), WsdlDefinitionHandlerAdapter.class);

      } catch (NoSuchBeanDefinitionException ignored) {
           wsdlDefinitionHandlerAdapter = new WsdlDefinitionHandlerAdapter();

   } catch (Exception ex) {
        throw new BeanInitializationException("Could not initialize WsdlDefinitionHandlerAdapter", ex);

My solution was:

Create in the Spring XML file a wsdlDefinitionHandlerAdapter bean and set the properties 'transformLocations' and 'transformSchemaLocations' with value true.

<bean id="wsdlDefinitionHandlerAdapter" class="org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter">
	<property name="transformSchemaLocations" value="true" />
    	<property name="transformLocations" value="true" />

Generated at Sun Nov 18 12:05:48 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.