Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0 M2
    • Component/s: Core
    • Labels:
      None

      Description

      One disadvantage of writing your WSDLs yourself is that you don't have dynamic address locations anymore. Sometimes, it is needed to transform the address given in the WSDL document to one that matches the current url of the war.

      Basically, this feature would allow people to use a relative paths in their wsdl description (such as /services/myservice). When a request comes in, the full context path is prepended to this relative url (resulting in something like http://example.com:8080/context/services/myservice).

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        This is now implemented in SVN.

        The basic idea is to define a WsdlDefinition bean in your app context, and to add the WsdlDefinitionHandlerAdapter to your *-servlet.xml app context. You then map the incoming requires for the WSDL file to the WsdlDefintion instead of the WSDL file itself.

        The adapter has a property transformLocations. When enabled, this adapter transforms all location attributes to reflect the incoming request.

        For instance, if the location attribute defined in the WSDL is http://localhost:8080/context/services/myService, and the request URI for the WSDL is http://example.com/context/myService.wsdl, the location will be changed to http://example.com/context/services/myService.

        Note that - contrary to my previous comment on this issue - you should not use relative URLs in the location!

        Show
        arjen.poutsma Arjen Poutsma added a comment - This is now implemented in SVN. The basic idea is to define a WsdlDefinition bean in your app context, and to add the WsdlDefinitionHandlerAdapter to your *-servlet.xml app context. You then map the incoming requires for the WSDL file to the WsdlDefintion instead of the WSDL file itself. The adapter has a property transformLocations. When enabled, this adapter transforms all location attributes to reflect the incoming request. For instance, if the location attribute defined in the WSDL is http://localhost:8080/context/services/myService , and the request URI for the WSDL is http://example.com/context/myService.wsdl , the location will be changed to http://example.com/context/services/myService . Note that - contrary to my previous comment on this issue - you should not use relative URLs in the location!
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Also, you can look in the echo sample, which uses this functionality.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Also, you can look in the echo sample, which uses this functionality.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Turns out that the relative path option can be pretty useful as well, especially in situations where the running context is not known beforehand (see http://forum.springframework.org/showpost.php?p=70606&postcount=9). So, I will implement this as well.

        Basically, if a location contains a relative url, the the full context path is prepended to this relative url. When the location is non-relative, only the server information is changed.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Turns out that the relative path option can be pretty useful as well, especially in situations where the running context is not known beforehand (see http://forum.springframework.org/showpost.php?p=70606&postcount=9 ). So, I will implement this as well. Basically, if a location contains a relative url, the the full context path is prepended to this relative url. When the location is non-relative, only the server information is changed.
        Hide
        kphonik Jason Stiefel added a comment -

        Thought this was worth commenting on since it's not clear from the above text just how to implement this feature. Adding a WsdlDefinitionHandlerAdapter to your servlet context is ignored from the MessageDispatcherServlet. The servlet instantiates it's own instance that is configured through exposed init-params on the servlet itself. So for the current version (1.0-rc2) you must add an init-param value to your web.xml:

        <servlet>
        <servlet-name>spring-ws</servlet-name>
        <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
        <init-param>
        <param-name>transformWsdlLocations</param-name>
        <param-value>true</param-value>
        </init-param>
        </servlet>

        I plan to open a bug regarding the handler adapter being overlooked within the servlet context.

        Show
        kphonik Jason Stiefel added a comment - Thought this was worth commenting on since it's not clear from the above text just how to implement this feature. Adding a WsdlDefinitionHandlerAdapter to your servlet context is ignored from the MessageDispatcherServlet. The servlet instantiates it's own instance that is configured through exposed init-params on the servlet itself. So for the current version (1.0-rc2) you must add an init-param value to your web.xml: <servlet> <servlet-name>spring-ws</servlet-name> <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class> <init-param> <param-name>transformWsdlLocations</param-name> <param-value>true</param-value> </init-param> </servlet> I plan to open a bug regarding the handler adapter being overlooked within the servlet context.

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            arjen.poutsma Arjen Poutsma
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: