Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web services question...
Message
De
16/02/2006 11:26:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01096721
Message ID:
01096761
Vues:
16
>Ok guys,
>
>I have a realy screwy problem happening and I can't seem to find any documentation to support what I'm seeing. It's difficult to explain, so I'll lay it out as an example to help you understand and hopefully provide me an answer.
>
>Background:
>
>I have an app that has a "local" data piece to it and a web service piece to facilitate synchronizing data between 2 or more machines. Let's say I have 1 machine in Dallas (CST) and one machine in Houston (aslo CST). The Web service is in Orlando (EST).
>
>Problem:
>
>Let's say I have data in Dallas with a record with a date (stored in SQL Server) as 2/15/2006 00:00:00.000. When I serialize the dataset using the WriteXml() method and pass it off to the web service, when the web service deserializes it using the ReadXml() method, it automatically adds 1 hour to it making it 2/15/2006 01:00:00.000. Since the field in question is an actual date, in the stored procedure I'm using, I convert the datetime to a plain date. (I ignore the time portion) so it gets stored as 2/15/2006 00:00:00.000.
>
>The second (and much more serious issue) comes in synchronizing the data to Houston. Once again, by using ReadXml(), .NET automatically converts the datetime value to CST by subtracting an hour. This means it becomes 2/14/2006 23:00:00.000. Again, since the field in question is a date, I ignore the time element and it becomes just 2/14/2006 00:00:00.000.
>
>Other items i have noticed:
>
>I have verified the actual XML before being passed into ReadXml() and the datetime value is exactly what it should be: 2/15/2006 00:00:00.000 in all instances, so I know it has something to do with the ReadXml() function.
>
>Additional Information:
>
>I am using ReadXml() with the ReadSchema option. I have tried this without the ReadSchema option and it doesn't make a difference. Also, this is not a typed dataset: it just a plain old normal dataset. Also, SQL Replication is not an option in this scenario as the web service is not on a box I own: it is in a managed hosting environment.
>
>So, any light you can shed on this issue would be greatly appreciated. If there's some way I can "turn off" this behavior, that would be even better.
>
>TIA,
>
>Travis

While it's the behavior of XML serializer think twice if you really want to convert. It might break synchorinizing (they're datetime values at the end not just date).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform