The .NET framework 3.5 introduces the new type DateTimeOffset. This type is implemented in the mscorlib.dll and it quasi extends the DateTime type for the property Offset, which is of type short. Because the DateTime type of .NET 2.0 is not quite useful in Web Service scenarios, I tested the new one.
Here is the example:
For this example following type has been used, which encapsulate both types DatTime and DateTimeOffset:
This code enforces WCF to sends two different messages.
<MessageLogTraceRecord>
<HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<Method>POST</Method>
<QueryString></QueryString>
<WebHeaders>
<VsDebuggerCausalityData>uIDPo7LpjCEdrp1Nil9FQsL8K00AAAAAJrB+6H6GakmqZaxnILapUc2qVlMrR71AmtK8q2tWSH4ACAAA</VsDebuggerCausalityData>
<SOAPAction>"http://Daenet.CalendarService/2007/08/GetHolidays"</SOAPAction>
<Connection>Keep-Alive</Connection>
<Content-Length>468</Content-Length>
<Content-Type>text/xml; charset=utf-8</Content-Type>
<Expect>100-continue</Expect>
<Host>dado-nb1</Host>
</WebHeaders>
</HttpRequest>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://dado-nb1/Temporary_Listen_Addresses/CalendarService</To>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://Daenet.CalendarService/2007/08/GetHolidays</Action>
</s:Header>
<s:Body>
<GetHolidayRequest xmlns="http://Daenet.CalendarService/2007/08">
<Date>8/9/2007 2:57:18 PM</Date>
<DateOffset xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema">
<DateTime i:type="x:dateTime" xmlns="">2007-08-09T12:57:18.7612886</DateTime>
<OffsetMinutes i:type="x:short" xmlns="">120</OffsetMinutes>
</DateOffset>
</GetHolidayRequest>
</s:Body>
</s:Envelope>
</MessageLogTraceRecord>
<MessageLogTraceRecord>
<HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<Method>POST</Method>
<QueryString></QueryString>
<WebHeaders>
<VsDebuggerCausalityData>uIDPo7PpjCEdrp1Nil9FQsL8K00AAAAAJrB+6H6GakmqZaxnILapUc2qVlMrR71AmtK8q2tWSH4ACAAA</VsDebuggerCausalityData>
<SOAPAction>"http://Daenet.CalendarService/2007/08/GetHolidays"</SOAPAction>
<Content-Length>482</Content-Length>
<Content-Type>text/xml; charset=utf-8</Content-Type>
<Expect>100-continue</Expect>
<Host>dado-nb1</Host>
</WebHeaders>
</HttpRequest>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://dado-nb1/Temporary_Listen_Addresses/CalendarService</To>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://Daenet.CalendarService/2007/08/GetHolidays</Action>
</s:Header>
<s:Body>
<GetHolidayRequest xmlns="http://Daenet.CalendarService/2007/08">
<Date>2007-08-09T14:57:20.0766149+02:00</Date>
<DateOffset xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema">
<DateTime i:type="x:dateTime" xmlns="">2007-08-09T12:57:20.0766149</DateTime>
<OffsetMinutes i:type="x:short" xmlns="">120</OffsetMinutes>
</DateOffset>
</GetHolidayRequest>
</s:Body>
</s:Envelope>
</MessageLogTraceRecord>