You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jose Manuel Valladares Pernas (JIRA)" <ax...@ws.apache.org> on 2006/09/22 16:33:37 UTC
[jira] Commented: (AXIS-2552) Java classes generated by wsdl2java
don't compile
[ http://issues.apache.org/jira/browse/AXIS-2552?page=comments#action_12436869 ]
Jose Manuel Valladares Pernas commented on AXIS-2552:
-----------------------------------------------------
Here it is the error when the generated class has two constructors that are the same:
package org.opentravel.www.OTA._2003._05;
/**
* A union of money and percentage so that the appropriate data can
* be sent in a single field.
*/
public class MoneyOrPercentageType implements java.io.Serializable, org.apache.axis.encoding.SimpleType {
private java.lang.String _value;
public MoneyOrPercentageType() {
}
// Simple Types must have a String constructor
public MoneyOrPercentageType(java.lang.String _value) {
this._value = _value;
}
public MoneyOrPercentageType(java.math.BigDecimal _value) {
setMoneyValue(_value);
}
public MoneyOrPercentageType(java.math.BigDecimal _value) {
setPercentageValue(_value);
}
It happens because the MoneyOrPercentageType is a union of the Money and Percentage that are decimal both:
<xs:simpleType name="Percentage">
<xs:annotation>
<xs:documentation xml:lang="en">Used for percentage values</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0.01"/>
<xs:maxInclusive value="100.00"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Money">
<xs:annotation>
<xs:documentation xml:lang="en">Used for amounts, max 3 decimals</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="3"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="MoneyOrPercentageType">
<xs:annotation>
<xs:documentation xml:lang="en">A union of money and percentage so that the appropriate data can be sent in a single field.</xs:documentation>
</xs:annotation>
<xs:union memberTypes="Money Percentage"/>
</xs:simpleType>
This bug happens also in axis 1.2.1 and it is still there in the 1.4 snapshot of September 22.
> Java classes generated by wsdl2java don't compile
> -------------------------------------------------
>
> Key: AXIS-2552
> URL: http://issues.apache.org/jira/browse/AXIS-2552
> Project: Apache Axis
> Issue Type: Bug
> Components: WSDL processing
> Affects Versions: 1.4
> Environment: Linux OpenSuse 10.1
> Java JDK 1.5.0_06-b05
> Apache Axis 1.4
> Reporter: Jose Manuel Valladares Pernas
> Attachments: files.ZIP
>
>
> I have an wsdl that imports several xsd schemas and I
> used an ant task with WSDL2Java to produce the
> corresponding java clases.
> WSDL2Java produces the classes and no errors. But some
> of the generated classes don't compile.
> One of the classes has 2 constructor methods that are
> the same. Other classes that inherite from some parent
> classes have the constructor parameters in the wrong
> order.
> The schema files should be correct as they come from the OTA specification.
> I am attaching the files I am using in a zip file.
--
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org