.NET Framework - Serilization of DateTime in WCF

Asked By dotNetDave
02-Feb-10 02:16 PM
I have business entity objects that I send out via a WCF service. Most of
these objects have DateTime properties. We store all of these values in our
database as PST but we have customers in all the time zones in North America.

The issue is that no time zone offset is being serilized along with the date
and time when it goes across the wire. I even set the DateTime Kind to
LocalTime or Utc and it still does not make a difference.

Any suggestions? Thanks.
David


======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''''s .NET Coding Standards available at:
http://codingstandards.notlong.com
DateTime
(1)
WCF
(1)
Database
(1)
LocalTime
(1)
McCarter
(1)
Utc
(1)
PST
(1)
  Mr. Arnold replied to dotNetDave
02-Feb-10 02:32 PM
Well, it looks like you are going to have to do the offset on the client
side.
help
Sevizio WCF e caching .NET Framework Ciao a tutti, ho un servizio WCF (httpBinding) che viene chiamato con una certa frequenza da diversi client. Il servizio legge dati da un database e li ritorna al chiamante. E' possibile implementare una cache lato servizio in modo che tempo (configurabile) restituisca, a parità di richiesta, la stessa risposta? Grazie, J. C# - Italian Discussions DateTime.Now.AddMinutes (1) HttpRuntime.Cache.Insert (1) DateTime (1) ASP.NET (1) IIS (1) WCF (1) AddMinutes (1) Visual (1) Ciao Tommy Vercetti, You wrote on 14 / 10 / 2009 : si lo puoi fare ma Wcf non ha nulla di pronto, probabilmente la soluzione "a dolore zero" ? Velocity. .m - - Mauro Servienti usando la cache di ASP.NET, in questo modo: HttpRuntime.Cache.Insert(cacheId, returnValue, null, DateTime.Now.AddMinutes(10), Cache.NoSlidingExpiration) Grazie per la risposta, TV - - Ciao Tommy Vercetti, You wrote
accessi contemporanei WCF o variabile in cache ASP.NET? .NET Framework Ciao a tutti! la mia applicazione WCF / ASP.NET manifesta un problema piuttosto grave (?? la prima applicazione che faccio di questo tipo). Una decina di magazzinieri accedono pi?? o meno contemporaneamente al database access, consultano e modificano le proposte d'ordine a loro indirizzate. Quando ci sono pi occhi la proposta di un altro magazziniere. L'applicazione ?? costiuita da 2 parti: un service WCF ospitato su IIS in un computer interno alla rete aziendale con Vista Business com s una variabile memorizzata nella cache, pu?? essere che questa variabile venga sovrascritta. Oppure il service WCF quando ci sono pi?? accessi contemporanei impazzisce e trasmette una proposta al posto di un collection di dati con la proposta Dim p As Pro = TPclient.TrasmettiPro(VNomePro) LATO SERVICE WCF ' prelevo i dati dal database access Public Function TrasmettiPro(ByVal sPro As String) As Pro _ Implements ITPro.TrasmettiPro Dim Function .NET Framework - Italian Discussions OleDbDataReader (1) OleDbConnection (1) OleDbCommand (1) IsDBNull (1) Vista (1) DateTime (1) ASP.NET (1) IIS (1) In mancanza di una soluzione certa, per ora ho
possible to host a web service on compact framework 3.5 ? I want to use WCF service but the class ServiceHost is not present into compact framework 3.5. Thanks, Paolo NET Compact Framework Discussions OEMGetRealTime (1) Linux (1) Environment.TickCount (1) GetTickCount (1) ServiceHost (1) DateTime (1) WCF (1) XP (1) The basic answer is no, not without components that do not come clear from the documentation, but the tools and code included with .NET CF are for WCF client creation. Paul T. Is there another way to hosting a web service on compact to reach it). Alberto Silva _ __ __ __ __ _ Information from ESET NOD32 Antivirus, version of virus signature database 4744 (20100105) _ __ __ __ __ _ The message was checked by ESET NOD32 Antivirus. http: / / www.eset.com they are running .NET CF programs side-by-side with such an extension to get WCF servers to work. I do not think that .NET CF was intentionally crippled, but certainly e. G. instead of reducing the available timer services to one, we have a crippled DateTime.Now which only goes to second resolution, and an Environment.TickCount, and have to sync to have it, but that does not mean that every application needs it. Point #2 (DateTime.Now), I think is because your target device (hardware), does not return anything in the
new timeStart being generated each tme. Thanks, Bob public class Service1 : System.Web.Services.WebService { DateTime timeStart = new DateTime(); public Service1() { timeStart = DateTime.Now; } [WebMethod] public string HelloWorld() { return "Hello World"+timeStart; } } C# Discussions WebService (1) DateTime (1) WCF (1) Application (1) Database (1) WebMethod (1) ObjectClass (1) TimeStart (1) Make it static. Or save it in Application way. . . in an enterprise setup, you'd probably want to look at a session-state database, probably keyed by a guid held as a header on the request. If you want something simpler (but less scale), then WCF can handle a lot of this for you in-memory (on a single machine - not