views:

542

answers:

0

Adobe Flex Builder WSDL classes autogenerator generates wierd files.

For example:

http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl

After importing it generates these files:

ArrayOfForecast.as
ArrayOfWeatherDescription.as
ArrayOfWeatherDescription0.as
BaseWeather.as
BaseWeatherSchema.as
Forecast.as
ForecastReturn.as
ForecastReturn0.as
GetCityForecastByZIPResultEvent.as
GetCityForecastByZIP_request.as
GetCityWeatherByZIPResultEvent.as
GetCityWeatherByZIP_request.as
GetWeatherInformationResultEvent.as
GetWeatherInformation_request.as
IWeather.as
POP.as
Temp.as
Weather.as
WeatherDescription.as
WeatherReturn.as
WeatherReturn0.as

What are these ZERO at the end files for?

That was an example for service with 3 operations. My real wsdl has much more methods and types.

UPDATED

At the same time Java generates much cleaner set of classes:

Forecast.java
ForecastReturn.java
POP.java
Temp.java
WeatherDescription.java
Weather.java
WeatherLocator.java
WeatherReturn.java
WeatherSoap12Stub.java
WeatherSoap.java
WeatherSoapProxy.java
WeatherSoapStub.java

It's not noticeable for such small service, but for bigger service with more operations and types it generates hundreds of classes. I have doubt that Adobe Flex team does wsdl classes autogeneration in proper way.

UPDATE-2

WeatherReturn.as:

 public class WeatherReturn
 {
  /**
   * Constructor, initializes the type class
   */
  public function WeatherReturn() {}

  public var Success:Boolean;
  public var ResponseText:String;
  public var State:String;
  public var City:String;
  public var WeatherStationCity:String;
  public var WeatherID:Number;
  public var Description:String;
  public var Temperature:String;
  public var RelativeHumidity:String;
  public var Wind:String;
  public var Pressure:String;
  public var Visibility:String;
  public var WindChill:String;
  public var Remarks:String;
 }

WeatherReturn0.as:

 public class WeatherReturn0
 {
  /**
   * Constructor, initializes the type class
   */
  public function WeatherReturn0() {}

  public var WeatherReturn:com.cdyne.WeatherReturn;
 }

WeatherReturn.java:

public class WeatherReturn  implements java.io.Serializable {
    private boolean success;
    private java.lang.String responseText;
    private java.lang.String state;
    private java.lang.String city;
    private java.lang.String weatherStationCity;
    private short weatherID;
    private java.lang.String description;
    private java.lang.String temperature;
    private java.lang.String relativeHumidity;
    private java.lang.String wind;
    private java.lang.String pressure;
    private java.lang.String visibility;
    private java.lang.String windChill;
    private java.lang.String remarks;

// Skipped constructors and getter/setter

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj)

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode()

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =  new org.apache.axis.description.TypeDesc(WeatherReturn.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://ws.cdyne.com/WeatherWS/", "WeatherReturn"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("success");
        elemField.setXmlName(new javax.xml.namespace.QName("http://ws.cdyne.com/WeatherWS/", "Success"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("responseText");
 // More typedesc here ...
    }

    public static org.apache.axis.description.TypeDesc getTypeDesc() {
    public static org.apache.axis.encoding.Serializer getSerializer(
    public static org.apache.axis.encoding.Deserializer getDeserializer(
}

I left only methods signatures for Java example and skipped getters/setters.