Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm excited about the possibilities for duplex communication with WebSockets between a web browser and web server. I see that WCF for .NET 4.5 supports a WebSockets binding now, and I know there's a JavaScript API for using WebSockets. However, what I don't understand is how these are supposed to interoperate. Yes, you can deal with raw message passing with the JS API, but there doesn't seem to be any JS library for doing SOAP-based RPC compatible with WCF.

Do any of you know if there are any libraries to enable a web browser to call a WCF service using WebSockets?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

SignalR has a JavaScript API. SignalR helps build asynchronous scalable web applications with real-time persistent long-running connections. Scott Hanselman wrote a great blog post about this.

If that's not your speed, you may be looking for something more like WCF Support for jQuery, which seems to have sprung up from the old WCF-RIA jQuery client. Looks like this will be part of ASP.NET MVC 4. The wiki page for this project seems to indicate that its flexible enough to plug in to WebSockets.

I'm a little concerned about WebSockets in the near term. There are some questions about just how Internet infrastructure (particularly in corporate environments where proxy servers are common) will handle WebSockets. I believe SignalR has strategies to help mitigate this by negotiating fallbacks when WebSockets don't work. Scott Hanselman has another blog post about this which makes some good points in this direction.

share|improve this answer
    
The SignalR alternative to WCF looks exceptionally promising. Thanks for your answer. –  Jacob Mar 10 '12 at 21:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.