History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-88
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan Diephouse
Reporter: Ralf Schaeftlein
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

xsd datatypes (date,time and timestamp)

Created: 10/Jun/05 03:53 PM   Updated: 18/Jun/05 02:03 PM
Component/s: Core
Affects Version/s: 1.0-M4
Fix Version/s: 1.0-M5

Time Tracking:
Not Specified

File Attachments: 1. XML File ProductService.wsdl (20 kb)
2. Java Source File ProductServiceImpl.java (4 kb)



 Description  « Hide
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)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Ralf Schaeftlein - 10/Jun/05 03:54 PM
generated wsdl

Dan Diephouse - 17/Jun/05 01:08 PM
I finally found some nice java code to do this in the ws-commons project at apache. This should now be no problem to do before m5

Dan Diephouse - 18/Jun/05 02:03 PM
I mapped Timestamp to xsd:dateTime and Time to xsd:Time