WSDL2Java generates uncompilable code for EBXML messaging schema
----------------------------------------------------------------
Key: AXIS-2605
URL: http://issues.apache.org/jira/browse/AXIS-2605
Project: Apache Axis
Issue Type: Bug
Components: WSDL processing
Affects Versions: 1.4
Environment: Duplicated on both Linux 2.6 and Windows 2000, Java
version 1.5.0_06-b05
Reporter: Joshua Davies
I'm working against a WSDL (which I was given and can't change), that depends
on ("<import>s") the EBXML message service specification
(http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd).
Unfortunately, WSDL2Java generates uncompilable code when the WSDL includes the
referenced msg-header-2_0.xsd file.
After some digging, I believe I was able to narrow down the problem, and
created a much smaller standalone wsdl that duplicates the problem exactly.
The attached sample code generates uncompilable code. The problem appears to
occur here (in the WSDL):
<schema targetNamespace="http://www.fail.com/nes"
xmlns:tns="http://www.fail.com/nes"
xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType name="non-empty-string">
<restriction base="string">
<minLength value="1" />
</restriction>
</simpleType>
<element name="Top">
<complexType>
<simpleContent>
<extension base="tns:non-empty-string">
<attribute name="type" type="tns:non-empty-string" />
</extension>
</simpleContent>
</complexType>
</element>
</schema>
This generates the following code:
package com.fail.www.nes;
public class Top implements java.io.Serializable, org.apache.axis.encoding.Simp
leType {
private java.lang.String type; // attribute
public Top() {
}
// Simple Types must have a String constructor
public Top(java.lang.String _value) {
super(_value);
}
Which, of course, fails with the following complie error:
com/fail/www/nes/Top.java:18: Object() in java.lang.Object cannot be applied to
(java.lang.String)
super(_value);
^
1 error
Because the code in question invokes a superconstructor but doesn't extend any
other class. I'm assuming that the problem is in the use of the "extension"
element, since if I remove that section, the generated code compiles just fine.
I'll attach the WSDL that I created that duplicates this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]