tags:

views:

771

answers:

4

I'm currently implementing a Silverlight application using WCF for the communication between client and server. I've heard that using WCF we're bound to use some Microsoft technology at the client side, and can't easily replace this with "anything" - at least with the default SOAP implementation of WPF.

So my questions are:

  • Is this true?
  • What about Restful WCF services? I picture a plain REST implementation, and any client could communicate with this server side through REST. Yes? No?
  • What are the (good) alternatives to throwing out WCF? And why would I want to do that?
+7  A: 

I've heard that using WCF we're bound to use some Microsoft technology at the client side

Well, then you've been lied to!

Many vendors and open source libraries support SOAP - it's a W3C standard, not a Microsoft-specific idea.

One great alternative for a RESTful service is ASP.NET MVC, which I've found a very easy way to expose methods directly as URLs.

Daniel Earwicker
Oh, well - that's a good thing then. I know SOAP isn't MS-specific, so I didn't really understand why WCF with SOAP would bind us to Microsoft. Thx for clearing this up! And SOAP is used by default when creating a WCF service, right?
stiank81
From the name "ASP .NET MVC" sounds like something you typically use in - well - an ASP .NET application. Sure - my Silverlight is wrapped in ASP, but will it suite my Silverlight app just as fine as it would for an ASP app?
stiank81
No, and yes ;). You have to specify binding(s) explicitly. So - you have to choose, therefore, word "default" doesn't fit here, on the other hand, you don't have to turn any magic option somewhere, it's your choice.
Ravadre
@bambushka - The Silverlight part of your app runs at the client. Are you trying to think of a way to allow clients elsewhere connect directly to that app? I'd assume not (it's basically not going to work, anyway.) Any kind of contactable web service must be running at the server. So by definition we're not talking about anything directly to do with Silverlight. We're talking about the server side. And that's where you'd use ASP.NET MVC. It's just a very easy way to cook up a custom server that can return data over HTTP; you just write a method or two, and make them return JSON or whatever.
Daniel Earwicker
No - nothing will connect to the Silverlight client. Yes - it is the server side that is of interest in this question. Oh - I see. But you don't have any ASP on the server side - isn't the name a bit confusing? Will look into ASP .NET MVC. Thx!
stiank81
ASP stands for Active Server Pages - seems pretty clear to me :) Are you really using *classic* ASP? i.e. not ASP.NET?
Daniel Earwicker
Oh, thx for clearing that up - have never worked with ASP.. Are anyone still using classic ASP? I meant ASP .NET..
stiank81
+1  A: 

For java - wcf interopibility check Sun's Project Tango link

Ray
Thx - useful read!
stiank81
+3  A: 

WCF gives you a level of abstraction over the way you are/want to communicate. So, you can choose binding that is Microsoft-specific, but you can also use SOAP protocol, or, you use both, so non-Microsoft client will be able to communicate through fe. SOAP, and other client can use more robust ways.
As for REST you might want to look at Hanselman's talk on NDC here. It might not answer you question directly, but it might point you something.
As for alternatives, I don't see anything that would run on .NET, besides web services (but, because WCF gives you all this and much more, I would rather consider it as an older way, than real an alternative).

Ravadre
Thx! Will check out Hanselman's talk (proper link: http://media01.smartcom.no/microsite/asx.aspx?eventid=4499). Well - if WCF doesn't bind me to Microsoft I'm happy with it. I will consider changing to REST though.. I feel that's often preferred over SOAP these days - but I might be wrong?
stiank81
REST is more fashionable at the moment. SOAP is overkill for most applications. XML is a poor fit for representing hierarchical data anyway. SOAP/WSDL is a giant mess of a standard, incorporating the XML Schema standard (which incorporates a regular expression standard from the Unicode consortium). Compared to all that, REST is almost nothing, basically just HTTP. And yet is more capable than basic SOAP (e.g. you can return an image as a binary stream).
Daniel Earwicker
I don't feel strong enough in this field to answer this question, but I know one thing, that Hanselman mentioned there - those technologies are great for client apps etc., but sometimes, the whole idea of getting (often) binary data and putting them as text inside brackets can be a too much of overhead. In WCF I like the fact, that I can write logic once (implementations of contracts) and then access them using many ways with ease.
Ravadre
@Ravadre - have you got a link to that Hanselman comment? The point I was making was that HTTP itself can return binary without needing to encode it as text, so if you (for example) want to return a PDF or JPEG or a ZIP download as the result of the method, you can just do that, by returning a ContentResult or a FileResult, etc. Take a look at the classes derived from http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx - so if you just want to return a stream of stuff as the result, it is zero coding effort and optimally implemented.
Daniel Earwicker
@Earwicker - You are right, this 'comment' is actually an answer at the end of the video, the whole point of my comment was (and I think - also Hanselman's), that using those formats like JSON generates overhead, so it's not always the best way to use them (ie. when returning huge amount of data). My last comment may be not precise (mostly, because it had to be short ;) ) - I'm not neglecting possibilities, I'm just pointing out, that using "text" protocols (soap,json) to return data is easy and convenient (fe. for easy parsing with js), but not always the best way to achieve the goal.
Ravadre
+2  A: 

WCF is SOAP-based (by default - also support REST) and can easily interoperate with any client that can understand and speak SOAP.

Those include languages and systems like Java, PHP and many many more.

WCF is Microsoft's implementation - but the standards are all international and interoperable standards. Nothing about the standards is Mircosoft specific.

Marc

marc_s
Everyone's saying WCF doesn't bind me to Microsoft :-) Good to hear - obviously I've been falsely informed.. Thx!
stiank81
While it sounds very good "on paper" in reality there is still plenty of small but annoying problems with interopibility...
Ray
Please elaborate on the "small but annoying problems with interoperability". Otherwise, you're as bad as the people who told the OP that WCF would bind him to Microsoft.
John Saunders