Results 1 to 2 of 2

Thread: Possible bug in DefaultWsdl11Definition

  1. #1
    Join Date
    Nov 2007
    Posts
    5

    Default Possible bug in DefaultWsdl11Definition

    Hello,

    I have problem using DefaultWsdl11Definition. Everything works fine if I use SimpleXsdSchema but when I switch to CommonsXsdSchemaCollection resulting wsdl has wrong default namespace in <schema> element. (I'm using VS 2008 to generate client based on wsdl and it works in one case and doesn't work in other). Here are the steps to reproduce the issue:

    messages.xsd
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http*//www*w3.org/2001/XMLSchema"
           targetNamespace="http*//www*tta.com/tigre/schemas/messages"
            elementFormDefault="qualified">
    
            <element name="testRequest" 	type="string"/>
            <element name="testResponse" 	type="string"/>
    
    </schema>
    spring-ws-servlet.xml with SimpleXsdSchema:

    Code:
    ...
    <bean id="someService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
        <property name="schema" ref="schema"/>
        ...
    </bean>
     
    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
        <property name="xsd" value="messages.xsd"/>
    </bean>
    ...
    Resulting wsdl has the following 'wsdl:types' section:
    Code:
    <wsdl:types>
        <schema xmlns="http*//www*w3.org/2001/XMLSchema" elementFormDefault="qualified" 
          targetNamespace="http*//www*tta.com/tigre/schemas/messages">
    
            <element name="testRequest" type="string"/>
            <element name="testResponse" type="string"/>
    
        </schema>
    </wsdl:types>
    Please note default namespace above - it is standard XMLSchema namespace and VS2008 has no problem using this wsdl.

    If I use spring-ws-servlet.xml with CommonsXsdSchemaCollection:

    Code:
    ...
    <bean id="someService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
        <property name="schemaCollection" ref="schemaCollection"/>
        ...
    </bean>
    
    <bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
        <property name="xsds">
            <list>
                <value>messages.xsd</value>
            </list>
        </property>
        <property name="inline" value="true"/>
    </bean>
    ...
    wsdl has the following 'wsdl:types' section:
    Code:
    <wsdl:types>
        <schema xmlns="http*//www*tta.com/tigre/schemas/messages" attributeFormDefault="unqualified" elementFormDefault="qualified"
        targetNamespace="http*//www*tta.com/tigre/schemas/messages">
            <element name="testRequest" type="string"/>
            <element name="testResponse" type="string"/>
        </schema>
    </wsdl:types>
    and VS 2008 cannot use it. If I change 'red' namespace above to "http*//www*w3.org/2001/XMLSchema" everything works OK.

    It looks like a bug in DefaultWsdl11Definition/CommonsXsdSchemaCollection or maybe there is something wrong with my configuration?

    Thanks,
    Sergey

  2. #2
    Join Date
    Nov 2007
    Posts
    5

    Default

    If use fully qualified namespaces everything works OK. So, schema should look like

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http*//www*w3.org/2001/XMLSchema"
           targetNamespace="http*//www*tta.com/tigre/schemas/messages"
            elementFormDefault="qualified">
    
            <xs:element name="testRequest" 	type="xs:string"/>
            <xs:element name="testResponse" 	type="xs:string"/>
    
    </xs:schema>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •