views:

70

answers:

1

Spring-WS 1.5: Using SimpleWsdl11Definition, exposing a WSDL is straightforward (from Spring-WS doc) in XML configuration:

<bean id="orders" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
    <constructor-arg value="/WEB-INF/wsdl/Orders.wsdl"/>
</bean>

Yields a URL exposing the WSDL at:

http://localhost:8080/spring-ws/orders.wsdl

The SimpleWsdl11Definition bean id + ".wsdl" becomes the leaf of the WSDL's URL when deployed, which covers a single-node taxonomy.

I need to support exposure of WSDLs that have multi-node taxonomies.

For instance:

http://localhost:8080/spring-ws/domain/subdomain/foo.wsdl

How is this accomplished in Spring-WS? Bean ID attributes do not allow "/" characters, so I wonder what ways exist to influence the WSDL URL.

Note: Using generated WSDLs will not be on option (for backward-consistency reasons), for instance with DefaultWsdl11Definition. As with SimpleWsdl11Definition, I'd like to map requests for the WSDL to the static WSDL.

Thanks.

+1  A: 

After poking around spring-ws source, I found there is no support for exposing a multi-node path for static-sourced WSDL configuration.

So I subclassed MessageDispatcherServlet and SimpleWsdl11Definition, and in my servlet, provided my own WSDL-request mapper that supports existing WsdlDefinition beans, as well as my "location-specified" WsdlDefinition bean.

Yields ability to configure in this sort of manner:

<!-- exposes URL:  host/context-root/servlet-name/MyService.wsdl -->
<bean id="MyService" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
    <property name="wsdl" value="/WEB-INF/wsdl/MyService.wsdl" />
</bean>

<!-- exposes URL:  host/context-root/servlet-name/some/multi/node/taxonomy/path/MyService.wsdl -->
<bean id="MyService.otherVersion" class="path.to.my.EnhancedWsdl11Definition">
    <property name="wsdl" value="/WEB-INF/wsdl/otherVersion/MyService.wsdl" />
    <property name="locationUri" value="some/multi/node/taxonomy/path/MyService.wsdl" />
</bean>

All is well.

bug11