Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsdl generation issue with CommonsXsdSchemaCollection [SWS-861] #930

Closed
gregturn opened this issue Jan 17, 2014 · 3 comments
Closed

wsdl generation issue with CommonsXsdSchemaCollection [SWS-861] #930

gregturn opened this issue Jan 17, 2014 · 3 comments
Assignees
Milestone

Comments

@gregturn
Copy link
Contributor

Stanislaw Hein opened SWS-861 and commented

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


Affects: 2.1.3

Referenced from: commits 50fe028, ea9e2d1

@gregturn
Copy link
Contributor Author

gregturn commented Feb 3, 2014

Arjen Poutsma commented

Can you elaborate on which specific attributes were lost? You mention that nillable="false" was lost, but that is not a problem, because nillable is false by default (see http://www.w3schools.com/schema/el_element.asp) and does not need to be specified.

@gregturn
Copy link
Contributor Author

gregturn commented Feb 3, 2014

Stanislaw Hein commented

Sorry for bad example. I tried with nillable="true" and it didn't work too. Also minOccurs and maxOccurs didn't work.

@gregturn
Copy link
Contributor Author

Arjen Poutsma commented

I'm afraid I can't reproduce this. I've added additional tests for this purpose (see ea9e2d1) but it works fine for me.

@gregturn gregturn added this to the 2.2.RC1 milestone Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants