-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signalr DateTime Request/Response disparity #46
Comments
Not sure what you mean? Are you saying things are double serialized? We serialize outgoing messages using the JavascriptSerializer in System.Web.Extensions by default (you can replace this). |
Hi David, Sorry, I have continued the discussion on the Stack Overflow thread. To elaborate, sending the same object received be server push, back to the hub causes a serialization failure. Thanks Sent from my iPhone On 26/10/2011, at 4:15 PM, David Fowlerreply@reply.github.com wrote:
|
I've reproed this. Thanks for filing it |
This seems to be a limitation of the JavascriptSerializer we're using. The date format isn't roundtrippable. |
I am using WCF data services to 'query' for data models from my web application, but then I use SignalR to receive 'push' updates.
WCF Data Services (OData) formats dates as a string in the format "/Date(1319493384779)/". This is fine, because I then generate client-side (javascript) viewmodels where I create actual Javascript Date() objects. SignalR also sends DateTime objects from the server to the client as "/Date(1319493384779)/", but it appears to expect an actual Date() object when passing from javascript to a server hub method via Javascript - using the above date format causes a format exception in the JSON deserializer. This is rather inefficient, because I already have a model object in javascript, and I should just be able to send it to a SignalR hub as-is.
Does anybody have any idea why this is happening?
(SO: http://stackoverflow.com/questions/7882535/signalr-datetime-request-response-disparity)
The text was updated successfully, but these errors were encountered: