I'm attempting to communicate with a Java webservice via a .NET application, using a Visual Studio Service reference (System.ServiceModel namespace classes). I've found that whenever it serializes a DateTime value it does not specify the offset. The problem is two fold:
I can't figure out how to create a DateTime object with a specific time zone. I can create a DateTimeOffset that will accomplish this, but the service client is expecting a DateTime object.
When the DateTime object is serialized, it does not include the time zone offset.
To elaborate on issue #2, the XML that the service expects for the timestamp object is as follows:
However, the XML that I see when tracing the .NET app is as follows:
The web service requires the time zone, because the underlying data is tracked in GMT-0. The data that is returned is in daily intervals, so if I don't specify a time zone then I get data back for GMT-0. Only when I provide the offset in the query do I get the in the data correct time zone.