Live data from Hacker News

WCF is Open Source

dotnetfoundation.org

71–80 of 149 posts

Re: WCF is Open Source

#71
post #53

Earlier quoted context omitted.

WCF is passable iff both your sides are .NET - in which case it is an overkill, slow and unneededly complex. If your other endpoint is not .NET, it's all of that and also horribly broken. 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 ..…

I remember so much pain trying to get a .NET WCF and Java SOAP service to work together when they should have been compatible. This is an amusing read: http://harmful.cat-v.org/software/xml/soap/simple :) 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

Strangely that's the one area where I've always had success with WCF.

Re: WCF is Open Source

#72
post #53

Earlier quoted context omitted.

WCF is passable iff both your sides are .NET - in which case it is an overkill, slow and unneededly complex. If your other endpoint is not .NET, it's all of that and also horribly broken. 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 ..…

> Have enumerations somewhere? WCF will encode them as integers. 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.

On phone, can't copy/paste.

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.

Re: WCF is Open Source

#73
post #56

Nice. WPF, please

... and VB6

I'm always surprised by the people asking "bring VB6 back". I'd like to know why - is it because you're stuck maintaining VB6 applications that can't be/haven't been updated to VB.net or C#? I used VB6 extensively back in the day, and I am very glad indeed that it's now dead.

Re: WCF is Open Source

#74

Earlier quoted context omitted.

What are some other libraries and frameworks that should be used? (For C# web services)

ASP.NET Web API http://www.asp.net/web-api

There is also a proxy generator for Web API so you still keep some of the benefits of WCF.

https://github.com/faniereynders/WebApiProxy/wiki/WebApi-C%2...

Re: WCF is Open Source

#75

I love C# and .NET, but WCF is a true source of frustration. It isn't horribly bad, but there is nothing good about it either. It's too complex, too messy, and too "Microsofty" for lack of a better word. Many layers of abstraction, hidden magic in XML files (which you can of course turn off, but then you need to know how to), and so on. Nevertheless, shares of coders blindly use WCF, "because Microsoft tells us to".…

The last time I used WPF was for IPC - and it worked pretty well for that use-case.

Re: WCF is Open Source

#76
post #61

Microsoft fanboy here. But... this product is total shit. Even if you're tasked with some horror like talking to an overdesigned XML backend written in Java nine years ago that uses an alternate canonicalization for digitally-signed XML and requires a slightly-deviant form of SOAP authentication... well, it'll eventually work. The source won't help you. It's the least of your concerns. This is exactly the type of ove…

I've been there and this tool is invaluable: http://www.soapui.org/

That and wireshark, and netmon. OK, I need to stop now or the repressed memories will come back. :)

Re: WCF is Open Source

#77
post #65

Earlier quoted context omitted.

The ServiceStack.Redis client uses pooled ThreadSafe Client Managers by design: https://github.com/ServiceStack/ServiceStack.Redis#redis-cli... 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.

Sorry, I know you worked hard on it but this comes from real experience. We had an absolute nightmare debugging strange issues in the cache and traced it to this. Probably an older version though.

Each threading issue reported ended up being traced back to sharing a RedisClient instance across multiple threads, e.g. by using a static RedisClient instance, registering RedisClient in IOC, etc - i.e. instead of using one of the ThreadSafe connection factories. If you have any repro showing any multi-threading issues with proper usage we'd love to hear about it (https://github.com/ServiceStack/Issues).

Re: WCF is Open Source

#78
WCF is very powerful and a piece of frustration. What's interesting is that most people have shared the common use of WCF which is interacting with Web Services and being JSON endpoints. There are better alternatives to make JSON endpoints in .NET. If you're using Web Services you're kind of stuck. So for a lot of people this is going to be useful.

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.

Re: WCF is Open Source

#79
post #72

Earlier quoted context omitted.

> Have enumerations somewhere? WCF will encode them as integers. 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.

On phone, can't copy/paste. 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 connectio…

> On XML iirc too

It serializes correctly.

For JSON you need an appropriate converter but as I said I would not use WCF with JSON.

Re: WCF is Open Source

#80

Earlier quoted context omitted.

> And it fails spectacularly. I mean, _it works_, but it's a disaster to work with and write software against. 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.

Have you used WCF talking to non-WCF WS-* things, or just WCF to WCF? My experience was that the latter (mostly) just worked but interop was somewhat of a nightmare, making the whole WS-* thing somewhat pointless. It wasn't really WCF's fault; just that no two WS-* implementations actually implemented things identically.

I've used it with all sorts of backends and clients. And you're right - in most cases it wasn't WCF's fault. Which is why I'm curious about why OP blames WCF.
Post reply on HN