I had a look at the date,time and timestamp return types. My test was with the following service (@see attachment):
public Date getCurrentDate() {
Date date = new Date();
log.debug("getCurrentDate="+date.toString());
return date;
}
public Time getCurrentTime() {
Date date = new Date();
Time time = new Time(date.getTime());
log.debug("getCurrentTime="+time.toString());
return time;
}
public Timestamp getCurrentTimestamp() {
Date date = new Date();
Timestamp time = new Timestamp(date.getTime());
log.debug("getCurrentTimestampe="+time.toString());
return time;
}
The generated wsdl look like this
<xsd:element name="getCurrentDateResponse">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element name="out" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element>
-------------
should that not be xsd:date as type attribute of out element?
-------------
<xsd:element name="getCurrentTimestampResponse">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element name="out" type="ns1:Timestamp" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:schema targetNamespace="http://sql.java" elementFormDefault="qualified" attributeFormDefault="qualified">
-
-
<xsd:complexType name="Timestamp">
-
<xsd:sequence>
<xsd:element name="date" type="xsd:int" nillable="true"/> <xsd:element name="day" type="xsd:int" nillable="true"/> <xsd:element name="hours" type="xsd:int" nillable="true"/> <xsd:element name="minutes" type="xsd:int" nillable="true"/> <xsd:element name="month" type="xsd:int" nillable="true"/> <xsd:element name="nanos" type="xsd:int" nillable="true"/> <xsd:element name="seconds" type="xsd:int" nillable="true"/> <xsd:element name="time" type="xsd:long" nillable="true"/> <xsd:element name="timezoneOffset" type="xsd:int" nillable="true"/> <xsd:element name="year" type="xsd:int" nillable="true"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
--------------
shoudl that not be xsd:dateTime as type attribute of out element?
--------------
<xsd:element name="getCurrentTimeResponse">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element name="out" type="ns1:Time" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:schema targetNamespace="http://sql.java" elementFormDefault="qualified" attributeFormDefault="qualified">
-
<xsd:complexType name="Time">
-
<xsd:sequence>
<xsd:element name="date" type="xsd:int" nillable="true"/> <xsd:element name="day" type="xsd:int" nillable="true"/> <xsd:element name="hours" type="xsd:int" nillable="true"/> <xsd:element name="minutes" type="xsd:int" nillable="true"/> <xsd:element name="month" type="xsd:int" nillable="true"/> <xsd:element name="seconds" type="xsd:int" nillable="true"/> <xsd:element name="time" type="xsd:long" nillable="true"/> <xsd:element name="timezoneOffset" type="xsd:int" nillable="true"/> <xsd:element name="year" type="xsd:int" nillable="true"/> </xsd:sequence> </xsd:complexType>
------------------
should that not be xsd:Time as type attribute of out element?
------------------
Date produce a string parseable with simpledateform as return type and timestamp a object with subelements as described in the complextype. The problem is only time which forces a error:
16354 [http-8080-Processor25] DEBUG test.ProductServiceImpl - getCurrentTime=21:53:18
16394 [http-8080-Processor25] DEBUG org.codehaus.xfire.aegis.type.basic.BeanType - Couldn't find type descriptor /java/sql/Time.aegis.xml
org.codehaus.xfire.XFireRuntimeException: Couldn't get property {http://sql.java}date
at org.codehaus.xfire.aegis.type.basic.BeanType.readProperty(BeanType.java:202)
at org.codehaus.xfire.aegis.type.basic.BeanType.writeObject(BeanType.java:170)
at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:84)
at org.codehaus.xfire.service.binding.WrappedBinding.writeMessage(WrappedBinding.java:127)
at org.codehaus.xfire.transport.AbstractSoapChannel.sendSoapMessage(AbstractSoapChannel.java:56)
at org.codehaus.xfire.transport.http.HttpSoapChannel.send(HttpSoapChannel.java:53)
at org.codehaus.xfire.exchange.RobustInOutExchange.doExchange(RobustInOutExchange.java:100)
at org.codehaus.xfire.transport.SoapServiceEndpoint.onReceive(SoapServiceEndpoint.java:70)