axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean ANDRE <jan...@cmtek.com>
Subject Re: float type and date time format
Date Mon, 13 Dec 2004 14:43:27 GMT
Hello Samisa Abeysinghe,

According to John Bofish email, the "Z" is for UTC time and Zero Zone. 
The time format is correct but under other developpment tools as .Net 
and Java (but not Axis), the time is given in GMT.  "UTC is the 
successor of Greenwich Mean Time </wiki/Greenwich_Mean_Time>,".  So,  
the question is now, could we support both format or translate one to 
another one easily, under the hood. It if really necessary to support 
both formats, does existing architectures and softwares understand the 
UTC format ?
As I wasn't able to complete test under Axis due to some bug with 
Complex Structure (soaq response) , I can't tell you if the Z is an issue.

> That's a good guess. 'Z' is for "UTC", or Coordinated Universal Time. See
> http://en.wikipedia.org/wiki/Coordinated_Universal_Time for more on UTC.

> The World Wide Web Consortium has a note about date and time formats
> (http://www.w3.org/TR/NOTE-datetime) where it states:

Thank you very much for your answers.

Best regards,

Jean A. - Canada -




Samisa Abeysinghe wrote:

>Bonjour Jean,
>
>Re: the datetime problem.
>I had a look at the source and the trailing 'Z' character seems to be
>hard coded in the serialize code in src/common/AxisTime.cpp. There is
>no mention  of why Z has been used there - not even a comment, so I am
>not sure what it means.
>
>However, if we want to change the format, we can do that by fixing the code. 
>
>Also, I used Axis Java's echo service and client samples, and saw that
>Axis Java also send something similar to "2004-12-13T14:45:11Z".
>
>BTW, you have copied values from  tm struct to xsd__dateTime struct.
>This is not necessary, as the xsd__dateTime is defined to be of type
>tm. So you can use type tm directly as the parameter to the web
>service method.
>
>Thanks,
>Samisa...
>
>
>On Thu, 09 Dec 2004 20:30:34 +0500, Jean ANDRE <jandre@cmtek.com> wrote:
>  
>
>>Bonjour everybody!
>>
>>Well, I have a strange behavior with floating number and date time format.
>>
>> 1 ) With float number, 77.99 becomes 77.989998 output string under
>>Axis. Why I lost some digits ??????!!!
>>
>> 2) With datetime format , in c++ test code, I just  moved some fields
>>to another one of the same structure and I get the following output
>>string: with Axis
>>    <txnDate>*2004-12-09T19:54:32Z*</txnDate>
>>
>> I supposed that Z is for TimeZone ?  But how to construct a time to
>>obtain such string ?
>>
>>With dot-net client application and a java application I got the
>>following string:
>><txnDate>2004-12-08T00:00:00.0000000-05:00</txnDate>
>>
>>Thanks a lot for your answers. Take care!
>>
>>Jean .A - Canada
>>
>>In c++ test code, I put the following code according to the WSDL.
>>
>>C++ Test code under Microsoft  Visual C++
>>==============================
>>class TxnAmount
>>{
>>public:
>>    float amount;
>>    xsd__string currency;
>>    TxnAmount();
>>    ~TxnAmount();
>>};
>>
>>    xsd__dateTime txnDate;
>>    tm* curTime;
>>    time_t timer;
>>
>>    amount.amount = 77.99;                // paymentForm.amount
>>    amount.currency = "USD";            // paymentForm.currency
>>
>>    memset(&txnDate, 0x00, sizeof(xsd__dateTime));
>>    timer = time(NULL);
>>    curTime = localtime( &timer );
>>    txnDate.tm_isdst    = curTime->tm_isdst;
>>    txnDate.tm_hour        = curTime->tm_hour;
>>    txnDate.tm_min        = curTime->tm_min;
>>    txnDate.tm_sec        = curTime->tm_sec;
>>    txnDate.tm_wday        = curTime->tm_wday;
>>    txnDate.tm_yday        = curTime->tm_yday;
>>    txnDate.tm_mday        = curTime->tm_mday;             //
>>paymentForm.txnDateD - day of the month - [1,31]
>>    txnDate.tm_mon        = curTime->tm_mon;                //
>>paymentForm.txnDateM - months since January - [0,11]
>>    txnDate.tm_year        = curTime->tm_year;                //
>>paymentForm.txnDateY - years since 1900
>>
>>Fragment of the WDSL:
>>==================
>>      <xs:element name="txnDate" type="xs:dateTime" minOccurs="0">
>>      </xs:element>
>>      <xs:complexType name="TxnAmount">
>>        <xs:sequence>
>>          <xs:element name="amount">
>>            <xs:simpleType>
>>              <xs:restriction base="xs:float">
>>                <xs:minInclusive value="0.00"/>
>>                <xs:maxInclusive value="9999999999.99"/>
>>              </xs:restriction>
>>            </xs:simpleType>
>>          </xs:element>
>>          <xs:element name="currency" minOccurs="0">
>>            <xs:simpleType>
>>              <xs:restriction base="xs:string">
>>                <xs:enumeration value="USD"/>
>>                <xs:enumeration value="CAD"/>
>>              </xs:restriction>
>>            </xs:simpleType>
>>          </xs:element>
>>        </xs:sequence>
>>      </xs:complexType>
>>
>>Fragment of the string sent by AXIS ??  Look the field amount !!!!
>>=============================================
>><ns1:txnRequest>
>><orderTotal>
>><amount>77.989998</amount>
>><currency>USD</currency>
>></orderTotal>
>><billTo>
>>
>><txnDate>*2004-12-09T19:54:32Z*</txnDate>
>>
>>
>>    
>>
>
>  
>


Mime
View raw message