Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web services question...
Message
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:
01096734
Vues:
18
You're welcome. Let us know how you end up resolving the problem! =)

~~Bonnie


>That's exactly the problem. Thank you very much. I'll see what I can do to resolve it knowing the time zone is stored as part of the datetime field.
>
>>Travis,
>>
>>You say you've looked at the XML, but I bet you missed one important piece of information ... part of the XML info in date/time fields indicate time zone:
>>
>><startdatetime>2001-08-31T00:00:00.0000000-07:00</startdatetime>
>>
>>Notice the -07:00 in the above field, indicating UT -7. I don't know if it's .NET or Windows itself that changes this in your WebService, but you probably can't turn it off.
>>
>>I think you have two options:
>>
>>1) Don't mess with the time portion of your date (don't set it back to 00:00:00), that may or may not solve it, I'm not sure.
>>
>>2) Pass the date as a string rather than a datetime field, converting it after to the appropriate type. You still might have to mess with timezone stuff though when you convert it, I don't know ... you'll just have to play with it and see what happens.
>>
>>~~Bonnie
>>
>>
>>
>>
>>>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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform