Announcement Announcement Module
Collapse
No announcement yet.
Namespace declaration removed when SimpleWsdl11Definition is used Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Namespace declaration removed when SimpleWsdl11Definition is used

    Hi,

    I'm having problems with the SimpleWsdl11Definition. If I set 'transformLocations' to true (using the transformWsdlLocations init parameter in web.xml), I find that my namespace declarations inside the wsdl are removed.

    E.g.

    Code:
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:schema="http://www.springframework.org/spring-ws/samples/echo" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.springframework.org/spring-ws/samples/echo">
    	<wsdl:types>
    		<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.springframework.org/spring-ws/samples/echo" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.springframework.org/spring-ws/samples/echo">
    			<include schemaLocation="xsd/echoService.xsd"/>
    		</schema>
    	</wsdl:types>
    	<wsdl:message name="echoRequest">
    		<wsdl:part name="echoRequest" element="schema:echoRequest">
        </wsdl:part>
    becomes

    Code:
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.springframework.org/spring-ws/samples/echo">
    	<wsdl:types>
    		<schema xmlns="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.springframework.org/spring-ws/samples/echo">
    			<include schemaLocation="xsd/echoService.xsd"/>
    		</schema>
    	</wsdl:types>
    	<wsdl:message name="echoRequest">
    		<wsdl:part element="schema:echoRequest" name="echoRequest">
        </wsdl:part>

    I.e. the declarations xmlns:schema="http://www.springframework.org/spring-ws/samples/echo" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" are removed from the <wsdl:definitions/> tag.
    Also the declaration xmlns:tns="http://www.springframework.org/spring-ws/samples/echo" is removed from the <schema/> tag.

    Surely you can imagine that this leads to "issues" downstream.

    The echo sample clearly demonstrates that the same does not happen with a DynamicWsdl11Definition if transformLocations is set to true.

    I've looked into the source and found that the SimpleWsdl11Definition creates a SAXSource from the wsdl resource specified.

    So maybe it's a SAX problem similar to http://forums.java.net/jive/thread.j...22271&tstart=0 but the difference is that this happens during the xpath transformation of the location (in WsdlDefinitionHandlerAdapter).

    Any ideas?

    It might be my environment, as I'm running on WAS 6.0.

  • #2
    And no, this does not happen if I set 'transformLocations' to false.

    Comment


    • #3
      I've reproduced this with sun jdk and the echo sample

      Hi,

      I believe this is a bug and I've reproduced this with the Sun JDK (1.5.0.12) and the standard echo sample extracted from spring-ws-1.0.1 (full), using the following steps:
      • Valid wsdl with DynamicWsdl11Definition
        Go to samples/echo and run
        Code:
        mvn:jetty:run
        Open the wsdl in XMLSpy (url=http://localhost:8080/echo/echo.wsdl)
        XMLSpy reports the wsdl as invalid, because the SOAP action is empty.
        Enter something in the SOAP action (just "test" will do) and revalidate.
        XMLSpy now reports the wsdl as valid.

      • Invalid wsdl with SimpleWsdl11Definition with transformWsdlLocations=false
        Copy / paste the valid wsdl from XMLSpy into a new file and save it inside samples/echo/src/main/webapp/WEB-INF/echo.wsdl
        Close the file in XMLSpy.

        Now modify bean="echo" in spring-ws-servlet.xml to use the SimpleWsdl11Definition (with property name="wsdl" value="/WEB-INF/echo.wsdl"

        Now re-run the sample using
        Code:
        mvn:jetty:run
        Re-open the wsdl in XMLSpy (url=http://localhost:8080/echo/echo.wsdl) and make sure 'reload' is selected, or otherwise XMLSpy will reuse the dynamically generated one (sigh).
        XMLSpy reports the wsdl as invalid, because the namespaces have been removed!!

      • Valid wsdl with transformWsdlLocations=false
        Close the file in XMLSpy.

        Now modify transformLocations="false" in web.xml

        Re-run the sample using
        Code:
        mvn:jetty:run
        Re-open the wsdl in XMLSpy (url=http://localhost:8080/echo/echo.wsdl) and make sure (again) that 'reload' is selected.
        XMLSpy now reports the wsdl as valid and note that all namespaces are still there.

      Comment


      • #4
        I've created http://opensource.atlassian.com/proj...browse/SWS-203 for this problem.

        Comment


        • #5
          Sorry for the copy/pasted typo's above, of course the command to run the echo sample is
          Code:
          mvn jetty:run

          Comment

          Working...
          X