DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9642>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9642 Java Date not deserialize properly Summary: Java Date not deserialize properly Product: Axis Version: beta-2 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Major Priority: Other Component: Serialization/Deserialization AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I created a Java bean that had a Date field in it. I then did Java2Wsdl and then WSDL2Java. I then deployed the server to a machine. Apon calling the server we recived the following error. Could not convert java.util.GregorianCalendar to bean field 'expires', type java.util.Date Here is my JavaBean /** * CreditCard.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package gov.uspto.ram; public class CreditCard implements java.io.Serializable { private java.lang.String name; private java.util.Date expires; private java.lang.String number; private java.lang.String postalCode; public CreditCard() { } public java.lang.String getName() { return name; } public void setName(java.lang.String name) { this.name = name; } public java.util.Date getExpires() { return expires; } public void setExpires(java.util.Date expires) { this.expires = expires; } public java.lang.String getNumber() { return number; } public void setNumber(java.lang.String number) { this.number = number; } public java.lang.String getPostalCode() { return postalCode; } public void setPostalCode(java.lang.String postalCode) { this.postalCode = postalCode; } private Object __equalsCalc = null; public synchronized boolean equals(Object obj) { if (!(obj instanceof CreditCard)) return false; CreditCard other = (CreditCard) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((name==null && other.getName()==null) || (name!=null && name.equals(other.getName()))) && ((expires==null && other.getExpires()==null) || (expires!=null && expires.equals(other.getExpires()))) && ((number==null && other.getNumber()==null) || (number!=null && number.equals(other.getNumber()))) && ((postalCode==null && other.getPostalCode()==null) || (postalCode!=null && postalCode.equals(other.getPostalCode()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getName() != null) { _hashCode += getName().hashCode(); } if (getExpires() != null) { _hashCode += getExpires().hashCode(); } if (getNumber() != null) { _hashCode += getNumber().hashCode(); } if (getPostalCode() != null) { _hashCode += getPostalCode().hashCode(); } __hashCodeCalc = false; return _hashCode; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( String mechType, Class _javaType, javax.xml.rpc.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType,null); }; /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( String mechType, Class _javaType, javax.xml.rpc.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType,null); }; } Here is my Wsdl <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="urn:Ram" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP- ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="urn:Ram-impl" xmlns:intf="urn:Ram" xmlns:tns1="http://ram.uspto.gov" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <types> <schema targetNamespace="http://ram.uspto.gov" xmlns="http://www.w3.org/2001/XMLSchema"> <complexType name="RamData"> <sequence> <element name="mailRoomDate" nillable="true" type="xsd:date"/> <element name="callingClientUserIdentifier" nillable="true" type="xsd:string"/> <element name="bankInfoRequestType" nillable="true" type="xsd:string"/> <element name="callingClientPortNumber" nillable="true" type="xsd:string"/> <element name="salePostingReferenceText" nillable="true" type="xsd:string"/> <element name="bankInfoPaymentType" nillable="true" type="xsd:string"/> <element name="saleOtherPaymentTotalAmount" type="xsd:double"/> <element name="fees" nillable="true" type="intf:ArrayOf_tns1_Fee"/> <element name="creditCard" nillable="true" type="tns1:CreditCard"/> </sequence> </complexType> <complexType name="Fee"> <sequence> <element name="code" nillable="true" type="xsd:string"/> <element name="amount" type="xsd:double"/> <element name="quantity" type="xsd:int"/> </sequence> </complexType> <complexType name="CreditCard"> <sequence> <element name="name" nillable="true" type="xsd:string"/> <element name="expires" nillable="true" type="xsd:date"/> <element name="number" nillable="true" type="xsd:string"/> <element name="postalCode" nillable="true" type="xsd:string"/> </sequence> </complexType> <complexType name="Response"> <sequence> <element name="salePostingReferenceText" nillable="true" type="xsd:string"/> <element name="authorization" nillable="true" type="xsd:string"/> <element name="hostResponseCode" nillable="true" type="xsd:string"/> <element name="hostResponseMessage" nillable="true" type="xsd:string"/> <element name="protoBaseResponseCode" nillable="true" type="xsd:string"/> <element name="protoBaseResponseMessage" nillable="true" type="xsd:string"/> <element name="transactionReferenceNumber" nillable="true" type="xsd:string"/> <element name="reasonCode" nillable="true" type="xsd:string"/> <element name="returnCode" nillable="true" type="xsd:string"/> <element name="accountingDate" nillable="true" type="xsd:date"/> </sequence> </complexType> </schema> <schema targetNamespace="urn:Ram" xmlns="http://www.w3.org/2001/XMLSchema"> <complexType name="ArrayOf_tns1_Fee"> <complexContent> <restriction base="SOAP-ENC:Array"> <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns1:Fee[]"/> </restriction> </complexContent> </complexType> <complexType name="ArrayOf_tns1_RamData"> <complexContent> <restriction base="SOAP-ENC:Array"> <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns1:RamData[]"/> </restriction> </complexContent> </complexType> <element name="ArrayOf_tns1_RamData" nillable="true" type="intf:ArrayOf_tns1_RamData"/> <complexType name="ArrayOf_tns1_Response"> <complexContent> <restriction base="SOAP-ENC:Array"> <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns1:Response[]"/> </restriction> </complexContent> </complexType> <element name="ArrayOf_tns1_Response" nillable="true" type="intf:ArrayOf_tns1_Response"/> </schema> </types> <wsdl:message name="validateResponse"> <wsdl:part name="return" type="intf:ArrayOf_tns1_Response"/> </wsdl:message> <wsdl:message name="validateRequest"> <wsdl:part name="in0" type="intf:ArrayOf_tns1_RamData"/> </wsdl:message> <wsdl:portType name="Ram"> <wsdl:operation name="validate" parameterOrder="in0"> <wsdl:input message="intf:validateRequest"/> <wsdl:output message="intf:validateResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="RamSoapBinding" type="intf:Ram"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="validate"> <wsdlsoap:operation soapAction=""/> <wsdl:input> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="validate" use="encoded"/> </wsdl:input> <wsdl:output> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:Ram" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="RamService"> <wsdl:port binding="intf:RamSoapBinding" name="Ram"> <wsdlsoap:address location="http://localhost:8080/Ram"/> </wsdl:port> </wsdl:service> </wsdl:definitions>