axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmytro Dyachuk (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-2340) BeanDeserializer cannot deserialize the array in the complex type
Date Thu, 15 Dec 2005 02:14:45 GMT
BeanDeserializer cannot deserialize the array in the complex type 
------------------------------------------------------------------

         Key: AXIS-2340
         URL: http://issues.apache.org/jira/browse/AXIS-2340
     Project: Apache Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.3    
    Reporter: Dmytro Dyachuk
    Priority: Blocker


The problem is the BeanSerializer throws an exception during deserializing the SOAP response
on the clients stub. It seems that it tries to cast to some type "[J" which is definately
is not long.

The soap message is:
<?xml version="1.0" encoding="utf-8"?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
         <ns1:createOrderResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://tpcapp.kvn.usask.ca">
            <createOrderReturn href="#id0"/>
         </ns1:createOrderResponse>
         <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:CreateOrderResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="structs.kvn.usask.ca">
            <systemId xsi:type="xsd:string" xsi:nil="true"/>
            <orderId xsi:type="xsd:long">740488771</orderId>
            <orderStatus xsi:type="xsd:string">PENDING</orderStatus>
            <orederTotal xsi:type="xsd:double">72875.404390735</orederTotal>
            <orderTax xsi:type="xsd:double">12442.961820735</orderTax>
            <orderShipCost xsi:type="xsd:double">28154.98</orderShipCost>
            <discount xsi:type="xsd:double">42.34</discount>
            <itemId xsi:type="xsd:long">7838</itemId>
            <itemId xsi:type="xsd:long">78844</itemId>
            <itemId xsi:type="xsd:long">50151</itemId>
            <itemId xsi:type="xsd:long">80088</itemId>
            <itemId xsi:type="xsd:long">88702</itemId>
            <itemId xsi:type="xsd:long">64908</itemId>
            <itemQty xsi:type="xsd:long">2</itemQty>
            <itemQty xsi:type="xsd:long">6</itemQty>
            <itemQty xsi:type="xsd:long">6</itemQty>
            <itemQty xsi:type="xsd:long">1</itemQty>
            <itemQty xsi:type="xsd:long">7</itemQty>
            <itemQty xsi:type="xsd:long">4</itemQty>
            <itemCost xsi:type="xsd:double">455.28</itemCost>
            <itemCost xsi:type="xsd:double">1935.29</itemCost>
            <itemCost xsi:type="xsd:double">3383.91</itemCost>
            <itemCost xsi:type="xsd:double">98.62</itemCost>
            <itemCost xsi:type="xsd:double">2256.43</itemCost>
            <itemCost xsi:type="xsd:double">1814.89</itemCost>
            <itemStatus xsi:type="xsd:string">PENDING</itemStatus>
            <itemStatus xsi:type="xsd:string">PENDING</itemStatus>
            <itemStatus xsi:type="xsd:string">PENDING</itemStatus>
            <itemStatus xsi:type="xsd:string">PENDING</itemStatus>
            <itemStatus xsi:type="xsd:string">PENDING</itemStatus>
            <itemStatus xsi:type="xsd:string">PENDING</itemStatus>
         </multiRef>
      </soapenv:Body>
   </soapenv:Envelope>
The exception:
- Could not convert java.lang.Long to bean field 'itemId', type [J
- Exception:
java.lang.IllegalArgumentException: argument type mismatch
	at org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:157)
	at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)
	at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
	at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
	at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
	at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:369)
	at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
	at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
	at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
	at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
	at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
	at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
	at org.apache.axis.client.Call.invoke(Call.java:2467)
	at org.apache.axis.client.Call.invoke(Call.java:2366)
	at org.apache.axis.client.Call.invoke(Call.java:1812)
	at ca.usask.kvn.tpcapp.client.axis.BookStoreService.BookStoreServiceSoapBindingStub.createOrder(BookStoreServiceSoapBindingStub.java:603)
	at ca.usask.kvn.tpcapp.client.BookstoreClient.createNewOrder(BookstoreClient.java:135)
	at ca.usask.kvn.tpcapp.client.ClientSuite.main(ClientSuite.java:55)


The code of the generated stub:
/**
 * CreateOrderResponse.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
 */

package ca.usask.kvn.tpcapp.client.axis.structs;

public class CreateOrderResponse  extends ca.usask.kvn.tpcapp.client.axis.structs.Response
 implements java.io.Serializable {
    private long orderId;

    private java.lang.String orderStatus;

    private double orederTotal;

    private double orderTax;

    private double orderShipCost;

    private double discount;

    private long[] itemId;

    private long[] itemQty;

    private double[] itemCost;

    private java.lang.String[] itemStatus;

    public CreateOrderResponse() {
    }

    public CreateOrderResponse(
           java.lang.String systemId,
           long orderId,
           java.lang.String orderStatus,
           double orederTotal,
           double orderTax,
           double orderShipCost,
           double discount,
           long[] itemId,
           long[] itemQty,
           double[] itemCost,
           java.lang.String[] itemStatus) {
        super(
            systemId);
        this.orderId = orderId;
        this.orderStatus = orderStatus;
        this.orederTotal = orederTotal;
        this.orderTax = orderTax;
        this.orderShipCost = orderShipCost;
        this.discount = discount;
        this.itemId = itemId;
        this.itemQty = itemQty;
        this.itemCost = itemCost;
        this.itemStatus = itemStatus;
    }


    /**
     * Gets the orderId value for this CreateOrderResponse.
     * 
     * @return orderId
     */
    public long getOrderId() {
        return orderId;
    }


    /**
     * Sets the orderId value for this CreateOrderResponse.
     * 
     * @param orderId
     */
    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }


    /**
     * Gets the orderStatus value for this CreateOrderResponse.
     * 
     * @return orderStatus
     */
    public java.lang.String getOrderStatus() {
        return orderStatus;
    }


    /**
     * Sets the orderStatus value for this CreateOrderResponse.
     * 
     * @param orderStatus
     */
    public void setOrderStatus(java.lang.String orderStatus) {
        this.orderStatus = orderStatus;
    }


    /**
     * Gets the orederTotal value for this CreateOrderResponse.
     * 
     * @return orederTotal
     */
    public double getOrederTotal() {
        return orederTotal;
    }


    /**
     * Sets the orederTotal value for this CreateOrderResponse.
     * 
     * @param orederTotal
     */
    public void setOrederTotal(double orederTotal) {
        this.orederTotal = orederTotal;
    }


    /**
     * Gets the orderTax value for this CreateOrderResponse.
     * 
     * @return orderTax
     */
    public double getOrderTax() {
        return orderTax;
    }


    /**
     * Sets the orderTax value for this CreateOrderResponse.
     * 
     * @param orderTax
     */
    public void setOrderTax(double orderTax) {
        this.orderTax = orderTax;
    }


    /**
     * Gets the orderShipCost value for this CreateOrderResponse.
     * 
     * @return orderShipCost
     */
    public double getOrderShipCost() {
        return orderShipCost;
    }


    /**
     * Sets the orderShipCost value for this CreateOrderResponse.
     * 
     * @param orderShipCost
     */
    public void setOrderShipCost(double orderShipCost) {
        this.orderShipCost = orderShipCost;
    }


    /**
     * Gets the discount value for this CreateOrderResponse.
     * 
     * @return discount
     */
    public double getDiscount() {
        return discount;
    }


    /**
     * Sets the discount value for this CreateOrderResponse.
     * 
     * @param discount
     */
    public void setDiscount(double discount) {
        this.discount = discount;
    }


    /**
     * Gets the itemId value for this CreateOrderResponse.
     * 
     * @return itemId
     */
    public long[] getItemId() {
        return itemId;
    }


    /**
     * Sets the itemId value for this CreateOrderResponse.
     * 
     * @param itemId
     */
    public void setItemId(long[] itemId) {
        this.itemId = itemId;
    }


    /**
     * Gets the itemQty value for this CreateOrderResponse.
     * 
     * @return itemQty
     */
    public long[] getItemQty() {
        return itemQty;
    }


    /**
     * Sets the itemQty value for this CreateOrderResponse.
     * 
     * @param itemQty
     */
    public void setItemQty(long[] itemQty) {
        this.itemQty = itemQty;
    }


    /**
     * Gets the itemCost value for this CreateOrderResponse.
     * 
     * @return itemCost
     */
    public double[] getItemCost() {
        return itemCost;
    }


    /**
     * Sets the itemCost value for this CreateOrderResponse.
     * 
     * @param itemCost
     */
    public void setItemCost(double[] itemCost) {
        this.itemCost = itemCost;
    }


    /**
     * Gets the itemStatus value for this CreateOrderResponse.
     * 
     * @return itemStatus
     */
    public java.lang.String[] getItemStatus() {
        return itemStatus;
    }


    /**
     * Sets the itemStatus value for this CreateOrderResponse.
     * 
     * @param itemStatus
     */
    public void setItemStatus(java.lang.String[] itemStatus) {
        this.itemStatus = itemStatus;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof CreateOrderResponse)) return false;
        CreateOrderResponse other = (CreateOrderResponse) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) && 
            this.orderId == other.getOrderId() &&
            ((this.orderStatus==null && other.getOrderStatus()==null) || 
             (this.orderStatus!=null &&
              this.orderStatus.equals(other.getOrderStatus()))) &&
            this.orederTotal == other.getOrederTotal() &&
            this.orderTax == other.getOrderTax() &&
            this.orderShipCost == other.getOrderShipCost() &&
            this.discount == other.getDiscount() &&
            ((this.itemId==null && other.getItemId()==null) || 
             (this.itemId!=null &&
              java.util.Arrays.equals(this.itemId, other.getItemId()))) &&
            ((this.itemQty==null && other.getItemQty()==null) || 
             (this.itemQty!=null &&
              java.util.Arrays.equals(this.itemQty, other.getItemQty()))) &&
            ((this.itemCost==null && other.getItemCost()==null) || 
             (this.itemCost!=null &&
              java.util.Arrays.equals(this.itemCost, other.getItemCost()))) &&
            ((this.itemStatus==null && other.getItemStatus()==null) || 
             (this.itemStatus!=null &&
              java.util.Arrays.equals(this.itemStatus, other.getItemStatus())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        _hashCode += new Long(getOrderId()).hashCode();
        if (getOrderStatus() != null) {
            _hashCode += getOrderStatus().hashCode();
        }
        _hashCode += new Double(getOrederTotal()).hashCode();
        _hashCode += new Double(getOrderTax()).hashCode();
        _hashCode += new Double(getOrderShipCost()).hashCode();
        _hashCode += new Double(getDiscount()).hashCode();
        if (getItemId() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getItemId());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getItemId(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getItemQty() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getItemQty());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getItemQty(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getItemCost() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getItemCost());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getItemCost(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        if (getItemStatus() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getItemStatus());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getItemStatus(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

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

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("structs.kvn.usask.ca", "CreateOrderResponse"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("orderId");
        elemField.setXmlName(new javax.xml.namespace.QName("", "orderId"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"long"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("orderStatus");
        elemField.setXmlName(new javax.xml.namespace.QName("", "orderStatus"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("orederTotal");
        elemField.setXmlName(new javax.xml.namespace.QName("", "orederTotal"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"double"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("orderTax");
        elemField.setXmlName(new javax.xml.namespace.QName("", "orderTax"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"double"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("orderShipCost");
        elemField.setXmlName(new javax.xml.namespace.QName("", "orderShipCost"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"double"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("discount");
        elemField.setXmlName(new javax.xml.namespace.QName("", "discount"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"double"));
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("itemId");
        elemField.setXmlName(new javax.xml.namespace.QName("", "itemId"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"long"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("itemQty");
        elemField.setXmlName(new javax.xml.namespace.QName("", "itemQty"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"long"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("itemCost");
        elemField.setXmlName(new javax.xml.namespace.QName("", "itemCost"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"double"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("itemStatus");
        elemField.setXmlName(new javax.xml.namespace.QName("", "itemStatus"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
        elemField.setNillable(true);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}




-- 
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


Mime
View raw message