It seems the WSDL java.sql.Date object is not being generated properly within Axis2 v1.1. The generate WSDL, viewed from the deployment of the service, shows a date definition as follows:
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://sql.java/xsd"> <xs:import namespace="http://calendar.util.sun/xsd"/> <xs:element name="Date" type="ax23:Date"/> <xs:complexType name="Date"> <xs:sequence> <xs:element name="hours" type="xs:int"/> <xs:element name="minutes" type="xs:int"/> <xs:element name="seconds" type="xs:int"/> <xs:element name="time" type="xs:long"/> <xs:element name="calendarDate" nillable="true" type="ax27:BaseCalendar$Date"/> <xs:element name="date" type="xs:int"/> <xs:element name="day" type="xs:int"/> <xs:element name="hours" type="xs:int"/> <xs:element name="julianCalendar" nillable="true" type="ax27:BaseCalendar"/> <xs:element name="minutes" type="xs:int"/> <xs:element name="month" type="xs:int"/> <xs:element name="seconds" type="xs:int"/> <xs:element name="time" type="xs:long"/> <xs:element name="timeImpl" type="xs:long"/> <xs:element name="timezoneOffset" type="xs:int"/> <xs:element name="year" type="xs:int"/> </xs:sequence> </xs:complexType> </xs:schema> Seems reasonable and note the type attribute "ax23:Date". Now the definition of the complex type that uses the Date object is as follows: <xs:complexType name="RegisterPassportData"> <xs:sequence> <xs:element name="poolName" nillable="true" type="xs:string"/> <xs:element name="sessionID" nillable="true" type="xs:string"/> <xs:element name="dateOfBirth" nillable="true" type="ax28:Date"/> <xs:element name="firstName" nillable="true" type="xs:string"/> <xs:element name="gender" nillable="true" type="xs:string"/> <xs:element name="issuingCountry" nillable="true" type="xs:string"/> <xs:element name="lastName" nillable="true" type="xs:string"/> <xs:element name="nationality" nillable="true" type="xs:string"/> <xs:element name="passengerType" nillable="true" type="xs:string"/> <xs:element name="passportNumber" nillable="true" type="xs:string"/> <xs:element name="referenceNumber" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> Also looks reasonable except for one thing. The type specified for the Date object is defined as "ax28:Date". There is no match within the generated WSDL for this type. When populating the complex type, I use the Date object provided as part of the generated stub for the dateOfBirth value. When this is deserialized into the java.sql.Data object on the server side (keep in mind the java.sql.Date object was used to generate the WSDL) I receive the following error on the server side: org.apache.axis2.AxisFault: java.sql.Date; nested exception is: java.lang.InstantiationException: java.sql.Date at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSup plier.java:28) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:26 1) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:29 1) at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java: 549) at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java :499) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:43 8) at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:109) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RP CMessageReceiver.java:116) at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abst ractInOutSyncMessageReceiver.java:39) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques t(HTTPTransportUtils.java:319) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:247) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 48) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86 9) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc essConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint .java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow erWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:684) at java.lang.Thread.run(Unknown Source) Is the above correct? Am I doing something wrong? Is there a trick that I am not seeing? Regards, Larry Johnson
