WCF is Open Source
dotnetfoundation.org
dotnetfoundation.org
There are very few modern use cases where WCF is the best option out there. If you want to make a RESTful API with .NET, please consider:
* ASP.NET MVC Web API
* ServiceStack
* Nancy
Nancy is basically Ruby's Sinatra but then on .NET.ServiceStack recently became commercial, but it still is the best designed API library I've ever seen, in any language. It makes you focus more on the actual data inside each request and response, and less on the form of that data (is it a query parameter, JSON POST field, or part of a fancy URL? who cares, design your messages first and then figure out what the URLs should look like). The result of this is that somehow you tend to automatically design forward-compatible, extensible API endpoints. I guess you really have to feel it to believe it, but I kid you not, with ServiceStack, it feels like your API designs itself in front of your eyes.
If anyone knows anything like ServiceStack on any other language, please tell me and I'm going to give you hugs.
Finally, MVC Web API is basically Rails's API controllers ported to C#. It has a tad too much magic for my taste, but it's a familiar and decent pattern that just works.
Please, please, let's just bury WCF and embrace the true goodies in the .NET open source ecosystem. It's nice that WCF got open sourced, but it's still a mess. If you really must go the "because Microsoft!" route, please just use ASP.NET MVC (also open source, and in active development).
As far as I can tell, Microsoft doesn't really push WCF any more simply because the use-cases are fewer and/or irrelevant in the current Web Service landscape.
I also get the feeling that many people commenting here didn't need to work with WS-* and associated technologies at the time WCF didn't exist. After its release it really was a choice between the lesser of two evils. But at the time, WCF was the mischievous kid who didn't do his homework, and everything else was the direct spawn of Satan.
A reminder of what WCF is (Wikipedia):
> a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications
> WCF is a tool often used to implement and deploy a service-oriented architecture (SOA)
For people who were around during the SOA dark ages, I won't be surprised if reading that sent shivers down your spine. Thankfully SOA, as it was evangelized, is pretty much dead. For everything else, these days better data-interchange technologies exist.
Could be wrong, but you seem to be downplaying how much of a development drag WCF ended up being on .Net and how poorly it is designed.
I was around that time too, and for me WCF was like a blast from the past even back then. It was like a bad .Net 1.0 library when it was brought out. Almost everything they could design badly and enterprisey, they managed to design badly and enterprisey. It reminded me of that terrible enterprise library they had.
Still pretty useful in consuming Salesforce's terrible api though.
Yes, you used Web Services to deal with SOAP messages. But SOAP was never the problem. WS-* was.
> These variety of specifications are the basic web services framework established by first-generation standards represented by WSDL, SOAP, and UDDI.[1] Specifications may complement, overlap, and compete with each other. Web service specifications are occasionally referred to collectively as "WS-", though there is not a single managed set of specifications that this consistently refers to, nor a recognized owning body across them all.
http://en.wikipedia.org/wiki/List_of_web_service_specificati...
I also don't understand why people think that "enterprisey" is inherently a bad thing? It was designed to be used in the enterprise. This is evident in it's relationship to SOA, which is basically its raison d'etre. When you build apps in enterprise environments you have to put with all kinds of crap to appease auditors and to adhere to various acts and governance frameworks and protocols so that you can maintain your position on whatever Stock Exchange etc. That's just the nature of the beast.
It's a pejorative term, not a descriptive one.
It means an over engineered solution to a simple problem that suffers heavily from YAGNI. It means catering to the 0.1% scenarios over the 99.9% scenarios. It means a complex generic solution where a simple one would have been better with custom code being used to handle the occasional complex scenario.
This is exactly my point. SOA in practice is not a simple problem, and it's the reason WCF exists so of course it's going to be complex. The whole idea of SOA means that you're inherently stuck with the problem of communicating with different different systems that talk different languages, by trying to coerce them into communicating via a standard format, which for all intents and purposes was rarely "standard". And of course these things have to be done in a secure fashion, with logging and auditing every step of the way, and with the ability to change configuration properties by editing a text file instead of having to via a Change Control Board and the entire QA process.
My feeling is that people who were using WCF for "simple" problems were probably using the wrong tool, even though in most cases it would have probably worked fine.
Of course everything else you say about logging, changing, etc. is correct - operationalizing a SOA is hard, which is why we see so many frameworks focused on cloud microservices today.
Your over enthusiasm for WCF seems to stem from your own lack of understanding of the major uses of WCF, you're citing a minor use case of WCF as if it were the primary one.
Also the hints you're dropping of your work programming environment sounds like a beauracratic nightmare.
https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110...
It kind-of does, though "work in" might be more accurately stated "sell to".
It would have been better if they kept and maintained a streamlined alternative. Forcing everyone to deal with the complexities of WCF isn't developer friendly.
This is a common anti-pattern in frameworks where they grow until they are a kitchen sink monster instead of splitting of into different frameworks streamlined for different purposes.
As soon as you run into edge-cases with authentication, compression, binary formats etc you'd have to use WCF. I think many use WCF "just in case" they need those features
Web API is great but actually came out of WCF despite being more like MVC (https://wcf.codeplex.com/wikipage?title=WCF%20Web%20API%20is...). Older versions used to serialise dates in a weird way but the latest version uses JSON.NET which is awesome.
I used to use ServiceStack and it was great although I hear even StackExchange are moving away from it now (https://blog.stackoverflow.com/2015/05/stack-exchange-podcas...). BTW use the StackExchange Redis client over the ServiceStack one as it's not properly thread safe.
Which works very much like a DB Connection, where the Connection Factory is thread-safe (and what's used to resolve connections) whilst the DB Connection instance it returns are not.
I had thought that MS might be on it now with Web API, but your comment suggests not.
The time and effort mythz et al put in would more than justify paying for a license vs taking on the mantle in my case.
IIRC WCF was used in CSLA to allow 2-tier apps to turn into 3-tier apps with just a config change. Probably the only good thing about it.
This is exactly what WCF let me do though and I wasn't limited to using HTTP like the others you listed. I was able to use a full duplex binary tcp channel instead.
For the server-side mounts, I had utility methods to mount several services into a single MVC web application, and it was just about seamless... for the project there was a base interfaces project that defined the services, so that the client and implementation were abstracted from eachother. It really was pretty slick in the end, and far from the default visual studio implementation.
I've also used WCF services as a message bus between a Flash/Flex simulation front end, and a connected backend service for that simulation instance. It wasn't bad.
That said, I much prefer to use node.js and simple JSON RPC and/or REST services these days over http or websockets (socket.io/sockjs), depending on what is pragmatic. It wasn't an option 8-9 years ago.
In practice you're almost always better off just picking a single format for your endpoint, in which case there's no reason to use WCF.
https://github.com/faniereynders/WebApiProxy/wiki/WebApi-C%2...
Nancy http://nancyfx.org/
service stack https://servicestack.net/
Asp.net web api http://www.asp.net/web-api
https://msdn.microsoft.com/en-us/library/jj823172%28v=vs.110...
My personal opinion is if you want to use an MS technology, use Web API unless you have a compelling reason to use WCF.
Have enumerations somewhere? WCF will encode them as integers. Have or need a date/time value in a format that isn't what WCF generates or expects - e.g. JSON Date() expressions? Doable, but error prone, slow and unintuitive (and ... In that case - why use WCF at all?)
WTF would have been a better name for this library.
The UK National Rail API is a WCF SOAP endpoint so I wrote this open source proxy with Web API to make it easier for non-.NET developers more familiar with restful JSON: https://github.com/jpsingleton/Huxley
Can you give an example of this? I have never had this problem.
> Have or need a date/time value in a format that isn't what WCF generates or expects
In my experience this is a data-interchange problem that will always exist. It is not unique to WCF.
I do agree that if you are using REST/Json then you should avoid WCF.
But e.g. Enum Direction { East, West, North, South };
Put that as a field in a structure that's sent/received through WCF; on JSON it will encode as numbers, regardless on any annotation you put. On XML iirc too - though I don't remember for sure. Want them as strings? You have to encode/decode yourself. But if you use .NET on both sides , you wouldn't notice unless you sniff the connection - until you change the enumeration order, for example, and all help breaks loose. Which is to be expected of a binary protocol, but completely unexpected for verbose text formats like JSON or XML.
It serializes correctly.
For JSON you need an appropriate converter but as I said I would not use WCF with JSON.
Also, the major advantage of SOAP is that at least it has a service description. So generating clients is an easy one step process (and, having shipped such a service, when works on many platforms and languages reasonably well). All these new HTTP/JSON APIs require custom clients each time. Until they invent WSDL for such services... And full circle. Except JSON instead of XML, so it's totally OK.
That being said...Scott Hanselman calls it WS-Death Star for a reason. (WS-*, heh. Nerd Jokes. Check.) Hopefully this kick starts the same kind of rapid evolution that Asp.net MVC had after it was open sourced.
A lot of the complexity is baked into the WS standards of which WCF is only an implementation. So until new standards are rolled out there is a limit to how much clean up can happen.
Then the other thing is the fundamental concept of WCF requires a lot of inherent complexity.
There is still a good amount of complex for complex's sake that could be cleaned up so hopefully that happens.
But its been said WCF is pretty much dead so not sure how much effort will go into it.
I know REST/JSON is the new hotness, but there is a bunch of that stuff out there.
I very much doubt that. WCF is one of the most over-engineered frameworks I've encountered so far, and I've seen many. It's an epitome of enterprisiness, with every miniscule detail configurable via XML, with countless layers of abstractions, factories and providers, with very specific modalities, with all kinds of pluggable serializers, with metric ton of other crap. Because WS-*.
So it's very unlikely that some average developer will go spelunking through the codebase to fix some obscure bug that occurs when interoperating with an Apache Axis-based Java web service that is using WS-ReliableMessaging with WS-Addressing over carrier pidgeons. Not gonna happen.
I know what you mean, though. I have this one web service that's the bane of my existence. No WSDL, it's WS-Transfer and MEX and WS-Sec with it's own STS...makes me weep thinking about it.
It will either be a godawful Fluent API on top of all the WCF craziness, or the conventions will be as unusable as they are in Entity Framework.
Old-style ASMX services were cool. Nothing fancy, no infinitely configurable doodads: just a single class annotated with attributes.
Conventions are supported as well, but is woefully underused.
That said, WCF is a beast. If you need SOAP with federated security and bells and whistles, it is a very solid choice.
If you can make it through with REST you should avoid WCF. It is a time sink.
While WCF supports WS-* and is in large part organized around it, some of the complexity isn't "because WS-", its "because WCF is a higher-level abstraction that supports, among other things, WS-* ".
I mean, you can apply all that overengineered configuration to build REST services with WCF, too. You probably don't want to (unless you are already heavily invested in WCF), but you can.
And it fails spectacularly. I mean, _it works_, but it's a disaster to work with and write software against.
The entire abstraction is leaking profusely, all precisely "because WS-*". Who in their right mind will attempt to establish a family of standards for "transport-agnostic" communication, routing, serialization and whatnot when realistically 99% of the time HTTPS is all you ever need?
Can you give an example of how it's a disaster? I'm genuinely curious because I've had to use it for at least 5 years (I still support 1 WCF solution) and this was never my experience.
This may be true to an extent, but rarely will you ever need to delve into that level of minutiae (which itself is a consequence of WS-*...). I've set up custom endpoints, but that's comparable to setting up custom logging with Log4J. I've extended/written custom Message Inspectors to log/analyze/manipulate data, but that was hardly complex as well, and comparable to what you would need to do in any other environment but without support of the framework.
For me the most frustrating thing working with WCF was probably correctly configuring Windows authentication/authorization simply because there are so many different ways things can fail with similar error messages. Everything else you mentioned is stuff that you rarely need to consider.
It would not surprise me to find enterprises still using WCF for interprocess communication and/or remote method invocation. When both client and server are .NET programs, most of the time it just works in my experience.
The abstraction is simply broken
It tried to be a common abstraction over http, tcp, message queue etc. Which is just not possible
There's too many specifics in each of them to have any sort of common interface (in all but the most simple examples)
WCF (Indigo) was the attribute-oriented distributed object framework that every COM developer dreamed of, co-designed by COM's rock star author, teacher and orator Don Box, based on the successor to DCOM, which was WS-star.
Back in the late 90s, there were basically three religions out there: CORBA, COM, and the nascent RESTafarians (REST wasn't coined until 2000, let's call these people "XML over HTTP" friends). Then Java came out with EJB and native CORBA, which everyone loved because it solved a problem with MTS/COM+ - it was simpler (believe it or not), and actually had a notion of lifecycle that was missing from most CORBA ORBs. Microsoft had to dodge this competitive threat, and IBM had to find a way to make MQ important again. XML was co-opted to be the new centre of everything, with the XML Infoset as the meta model for all data description AND message exchange. Protocols were to be a thing of the past, SOAP was protocol independent and WSDL described only message exchange patterns over TCP, UDP, HTTP, JMS or MQ. Never mind that 99% used HTTP and that all WSDL files were shared via HTTP GET. The church of WS* subsumed all other religions from around 2002 through 2007, and WCF was to be the crowning framework, destroying the ESB and the message broker the Microsoft Way.
Then around 2007 everyone woke up from their 15 year peyote trip and realized, after tireless arguments from the RESTafarians, particularly Mark Baker, that REST made sense and most of the specs in WS-* were reimplementations of what already existed (WS-Addressing EPRs replaced URIs; WS-SecureConverstion was multi-way SSL over XML exchanges), niche (WS-ReliableMessaging, WS-AtomicTransaction) or hopeless (WS-Policy and children). All work ceased on WS*, and people stopped worshipping communication protocols mostly. (except REST, which became a bit inquisitorial for a few years now that it won, given many years of being the laughing stock of billion dollar vendors)
REST on WCF was an afterthought that never really felt right. WCF was very general and smart, RESTful HTTP is very specific and even dumb. Different design for a different set of assumptions. That said I'm sure a lot can be learned from its approach to composing a generic layered system of communication capabilities.
If you don't need WS-*, use Web API services self hosted with Katana if you need to exchange data between applications/processes instead.
Katana/OWIN provides a pipeline for hosting .NET web[sites|services] without IIS. This is another direction .NET is heading, no more IIS shackling (if you so choose)
Plus, no need to rely on Powershell scripts, or god forbid, the user, to get the correct set of IIS features installed has made deployment of our apps infinitely simpler.
NancyFX all the way.
I wrote a blog post about it a while ago trying to untangle the difference between the two in some detail: http://jamesmckay.net/2014/08/sorting-out-the-confusion-that...
WCF is broad. Mind-bogglingly broad. I was in a project on we were implementing a P2P system on top of WCF and WCF has some mesh capability built in. Being able to use the same API for HTTP requests feels odd. Once I understood the breadth of what it can do it really lives up to its name. Unfortunately, it wasn't a focused API for most of what people needed it for.
I wrote a DSL to parse the messages and just stripped the message off the network stack before it even hit the application level where WCF would handle it. It gives me shivers just thinking about it.
https://msdn.microsoft.com/en-us/library/aa717047%28v=vs.110...
And no I could not get .NET to generate types from the WSDL and I knew about the tools provided for that. They didn't work and I wasted a lot of time on them because everything I read said they should work.
I used a DSL because that's what I knew and because I had already wasted too much time.
I've since learned to avoid situations like this but that's a whole 'nother comment.
For the record, I eschewed XML configuration for code and instead of supporting a range of protocols/transports, I used binary over TCP.
I had to look down on the page to figure out that it means "Windows Communication Foundation". It was not easy to quickly figure out what this actually means, but I guess that's since it's highly technical and I'm not immersed in the Microsoft/.Net talk.
It's time [to] explain the meaning of "Hurd". "Hurd" stands for "Hird of Unix-Replacing Daemons". And, then, "Hird" stands for "Hurd of Interfaces Representing Depth". We have here, to my knowledge, the first software to be named by a pair of mutually recursive acronyms.
Which is what you want in a communications library. But WCF is pretty hermetic when Bad Shit happens (and it will).
As much as I applaud this move by Microsoft, WCF has a reputation for being a terrible framework to work in the areas where it is most frequently employed, and I doubt it will be given the same welcome.
WPF, please
It's much easier to open-source the things with fewer dependencies, such as .NET Core, ASP.NET and other networking stuff. It's also invariably what customers are likely to want to run on Azure (or elsewhere), just maybe not with Windows underneath it.
For WPF I'm content with MS actually continuing development. WPF is the best UI framework I've used so far with a lot of good ideas that have sadly been ignored by most others. It's just sad that it got so little attention in recent years.
It is basically an extremely simple scripting language attached to a GUI designer (literally, originally VB was supposed to allow different languages to be used with it, but the feature was dropped).
Also it is instant fast on modern hardware.
Most people who have a grudge against VB1-6 have it either because they have no idea what they were talking about and are just parroting others (to be honest, i did that at the past), or were exposed to it via a project that abused it in ways that it wasn't meant to be (ab)used.
A while ago i made this little sprite editor in VB5:
http://runtimelegend.com/tools/mseditor/
It isn't anything special but it is actually quite useful if you're making low-res pixelart 2D games and personally i had fun making it (the first version also took me only a weekend although i added a few features since then).
Having said that, i do not expect Microsoft to bring back VB6 nor release the source code since now they seem to focus away from the desktop and VB6 is a full 1005 desktop technology.
What specifically do you find easier in VB6 than VB.net/C# when writing desktop apps, in particular in relation to WinForms?
You say "inspect and modify a program as it is running in a graphical way" - do you mean that with VB6 you could alter the UI as the application was running? If so, that's something I don't remember but I agree it could be very handy!
WCF is one of Microsoft's many examples of this principle. Avoid this, the solution hurts more than the problem.
Open sourcing an existing thing is never a bad thing though.
The source won't help you. It's the least of your concerns.
This is exactly the type of overdesigned schlock that Microsoft occasionally emits then gets stuck supporting because two big corporate clients signed on after two junior devs watched an MSDN talk with the nutjob who architected it. Avoid it.
I think you've found your problem.
I'm pretty sure everyone has had to deal with alien legacy systems at some point in their lives. It just goes with the territory. I have yet to come across a technology to that can handle all exceptions and edge cases.
That and wireshark, and netmon. OK, I need to stop now or the repressed memories will come back. :)
For example, on one WCF service I capture the message as it arrives and then write to disk. If I replay this message through SOAP UI, it fails unless I modify some of the headers.
WS-* just sucks in general.
Like any other writing, it's just about knowing your audience.
I mean, are you really going to write "HN (Hacker News)", "YC (Y Combinator)", "HTTP (Hyper-Text Transfer Protocol)", etc. every single time you use those in a comment here?
Is this really the case? I've been using it since it's inception (never used "Indigo" in production). At the time it was a godsend because our company was moving to a SOA (ahh... the dark ages) using Oracle Fusion Middleware, and judging by the job postings over the years I suspect many other non-Java/Oracle houses also adopted WCF.
I did not realize it was considered an obscure technology.
This is the third project I have worked on that uses WCF, and I have been working on the .NET platform since Beta.
It may be persnickety, but it just really throws me off when authors create a new acronym, and I have no idea what they're talking about.
Its all about the API for me. I don't want to see Device.FPC, when I have no idea FPC is a thing. I want to see Device.Power