Bug 536197 - Web Service Java client generator failing to emit a class with valid WSDL
Summary: Web Service Java client generator failing to emit a class with valid WSDL
Status: NEW
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: wst.wsdl (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: wst.wsdl CLA
QA Contact: Keith Chong CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2018-06-22 15:22 EDT by Thomas Hebert CLA
Modified: 2018-09-06 14:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hebert CLA 2018-06-22 15:22:09 EDT
What follows are two snippets of XMLSchema taken from a WSDL file:  Both are valid syntax and pass validation.  

When generating Java classes in Eclipse  wsdlfile.wsdl=>right-click=>Web Service=>Generate Client:...

This first snippet correctly generates a class named InputLinesType

      <s:element name="Input-Lines" type="tns:Input-LinesType" />
      <s:complexType name="Input-LinesType">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="20000" name="Input-Line">
            <s:simpleType>
              <s:restriction base="s:string">
                <s:maxLength value="80" />
              </s:restriction>
            </s:simpleType>
          </s:element>
          <s:element minOccurs="0" maxOccurs="1" name="Input-LineEnd">
            <s:simpleType>
              <s:restriction base="s:string">
                <s:maxLength value="80" />
              </s:restriction>
            </s:simpleType>
          </s:element>
        </s:sequence>
      </s:complexType>

This second snippets is accepted by the generator without complaint, however it fails to generate the Java class.   It then generates many references to the missing class:

      <s:element name="Input-Lines" type="tns:Input-LinesType" />
      <s:complexType name="Input-LinesType">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="20000" name="Input-Line">
            <s:simpleType>
              <s:restriction base="s:string">
                <s:maxLength value="80" />
              </s:restriction>
            </s:simpleType>
          </s:element>
        </s:sequence>
      </s:complexType>

It is important to note that both versions pass WSDL validation.  We need to use the second version because we can't control the definition of the service we are calling.  Note that version validates correctly in both Eclipse and VS Studio.  Visual Studio generates the InputLinesType type in both cases and calls can be successfully made to the service.  At this point we are blocked from moving forward, unless we switch to C# and VS.  

-- Configuration Details --
Product: Eclipse 4.7.3.20180405-1200 (org.eclipse.epp.package.jee.product)Installed Features:
 org.eclipse.wst.xml_ui.feature 3.9.2.v201803221834
Comment 1 Keith Chong CLA 2018-07-26 11:29:11 EDT
Hi Thomas, what web service runtime are you using?
Comment 2 Keith Chong CLA 2018-09-06 14:15:37 EDT
Hi Thomas, I'm going to lower the severity on this.  Are you using CXF JAX-WS?