Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-861

wsdl generation issue with CommonsXsdSchemaCollection

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.2.RC1
    • Component/s: XML
    • Labels:
      None

      Description

      while trying to generate wsdl from xsd the attributes minOccurs, maxOccurs, nillable and etc. are getting lost:
      xsd:

      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://services.webservices.customerapi.de" xmlns:objects="http://objects.webservices.customerapi.de"
        targetNamespace="http://services.webservices.customerapi.de" elementFormDefault="qualified" attributeFormDefault="qualified">
        <xsd:import namespace="http://objects.webservices.customerapi.de" schemaLocation="Hello.xsd" />
        <xsd:element name="HelloRequest">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element nillable="false" name="name" type="xsd:string"  />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="HelloResponse">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Hello" type="objects:Hello" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:schema>

      with such defined DefaultWsdl11Definition bean:

        <bean id="HelloService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
          <property name="schemaCollection">
            <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
              <property name="inline" value="true" />
              <property name="xsds">
                <list>
                  <value>schemas/HelloService.xsd</value>
                </list>
              </property>
            </bean>
          </property>
          <property name="portTypeName" value="HelloService" />
          <property name="serviceName" value="HelloService" />
          <property name="locationUri" value="/endpoints" />
        </bean>

      as a result am receiving wsdl (here only part of it):

        <xsd:element name="HelloRequest">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="name" type="xsd:string" /> <!-- here was "nillable" attr lost-->
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="HelloResponse">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Hello" type="objects:Hello" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>

      could you please check this issue, because it is very important for contract-data-first approach.

      regards

        Activity

        stasilla Stanislaw Hein created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Description while trying to generate wsdl from xsd the attributes minOccurs, maxOccurs, nillable and etc. are getting lost:
        xsd:

        <?xml version="1.0" encoding="UTF-8"?>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://services.webservices.customerapi.de" xmlns:objects="http://objects.webservices.customerapi.de"
          targetNamespace="http://services.webservices.customerapi.de" elementFormDefault="qualified" attributeFormDefault="qualified">
          <xsd:import namespace="http://objects.webservices.customerapi.de" schemaLocation="Hello.xsd" />
          <xsd:element name="HelloRequest">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element nillable="false" name="name" type="xsd:string" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="HelloResponse">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="Hello" type="objects:Hello" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:schema>

        with such defined DefaultWsdl11Definition bean:
          <bean id="HelloService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
            <property name="schemaCollection">
              <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
                <property name="inline" value="true" />
                <property name="xsds">
                  <list>
                    <value>schemas/HelloService.xsd</value>
                  </list>
                </property>
              </bean>
            </property>
            <property name="portTypeName" value="HelloService" />
            <property name="serviceName" value="HelloService" />
            <property name="locationUri" value="/endpoints" />
          </bean>

        as a result am receiving wsdl (here only part of it):
          <xsd:element name="HelloRequest">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="name" type="xsd:string" /> <!-- here was "nillable" attr lost-->
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="HelloResponse">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="Hello" type="objects:Hello" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>

        could you please check this issue, because it is very important for contract-data-first approach.

        regards
        while trying to generate wsdl from xsd the attributes minOccurs, maxOccurs, nillable and etc. are getting lost:
        xsd:

        {code:xml}
        <?xml version="1.0" encoding="UTF-8"?>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://services.webservices.customerapi.de" xmlns:objects="http://objects.webservices.customerapi.de"
          targetNamespace="http://services.webservices.customerapi.de" elementFormDefault="qualified" attributeFormDefault="qualified">
          <xsd:import namespace="http://objects.webservices.customerapi.de" schemaLocation="Hello.xsd" />
          <xsd:element name="HelloRequest">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element nillable="false" name="name" type="xsd:string" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="HelloResponse">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="Hello" type="objects:Hello" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:schema>
        {code}

        with such defined DefaultWsdl11Definition bean:
        {code:xml}
          <bean id="HelloService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
            <property name="schemaCollection">
              <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
                <property name="inline" value="true" />
                <property name="xsds">
                  <list>
                    <value>schemas/HelloService.xsd</value>
                  </list>
                </property>
              </bean>
            </property>
            <property name="portTypeName" value="HelloService" />
            <property name="serviceName" value="HelloService" />
            <property name="locationUri" value="/endpoints" />
          </bean>
        {code}
        as a result am receiving wsdl (here only part of it):
        {code:xml}
          <xsd:element name="HelloRequest">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="name" type="xsd:string" /> <!-- here was "nillable" attr lost-->
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="HelloResponse">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="Hello" type="objects:Hello" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        {code}
        could you please check this issue, because it is very important for contract-data-first approach.

        regards
        arjen.poutsma Arjen Poutsma made changes -
        Assignee Arjen Poutsma [ arjen.poutsma ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.1.5 [ 14349 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.2 [ 12850 ]
        Fix Version/s 2.1.5 [ 14349 ]

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            stasilla Stanislaw Hein
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: