Hi
Based on my research, this is a limitation.
Further, it turns out that forcing the System.XML.Serialization serializer
to encode a date value in GMT on the wire is not possible in .NET, at least
not today.
The Special Case of XML
Several people I've talked to recently had the design goal of serializing
time values over Web services such that the XML that represents the
DateTime would be formatted in GMT (e.g., with a zero offset). While I've
heard various reasons ranging from the desire to simply parse the field as
a text string for display in a client to wanting to preserve the "stored in
UCT" assumptions that exist on the server to the callers of Web services,
I've not been convinced that there is ever a good reason to control the
marshalling format on the wire to this degree. Why? Simply because the XML
encoding for a DateTime type is perfectly adequate for representing an
instant in time, and the XML serializer that is built into the .NET
Framework does a fine job of managing the serialization and deserialization
issues associated with time values.
Further, it turns out that forcing the System.XML.Serialization serializer
to encode a date value in GMT on the wire is not possible in .NET, at least
not today. As a programmer, designer, or project manager, your job then
becomes making sure that the data that is being passed in your application
is performed accurately with a minimum of cost.
Several of the groups I talked with in the research that went into this
paper had adopted the strategy of defining special classes and writing
their own XML serializers so that they have full control over what the
DateTime values on the wire looked like in their XML. While I admire the
pluck that developers have when making the leap into this brave
undertaking, rest assured that the nuances of dealing with daylight savings
time and time zone conversion issues alone should make a good manager say,
"No way," especially when the mechanisms provided in the .NET Framework do
a perfectly accurate job of serializing time values already.
There is only one trick you have to be aware of, and as a designer you MUST
understand this and adhere to the rule (see Rule #5).
Coding Best Practices Using DateTime in the .NET Framework
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
ml/datetimecode.asp
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Benjamin - 21 Jun 2005 07:18 GMT
Hi!
We see no manageble way to work with DateTime format, in our case.
We are going to convert the database column to string,
and send strings over web services and present strings in clients.
Thanks anyway.
Benjamin,
Sweden
"Peter Huang" [MSFT] - 21 Jun 2005 08:19 GMT
Hi
Yes, so far this is a limitation, that the XML serializer will do the
datetime convert on which webservice is based.
So far, the workaround to that, is to define that column as a string
column, so that the xml serializer will consider it as a common string.
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Benjamin - 13 Dec 2005 10:44 GMT
Now almost a year later, I would like to know if there are some news about
this (i e disabling time zone adjustment when sending data sets over web
services)in .NET Framework 2.0.