A comment
At some point, people need to understand that, business applications are not like console applications. So all these comments on the net, in blogs and forums, should be a little more double checked for real life development process because they mislead other people. Especially for LINQ to SQL and WCF, I am really bored reading about how great they are and how easy they are, but the truth is that LINQ to SQL is not for applications mainly because it is not thread safe and other related problems(explanation).Sadly I was one of the victims that tried to adopt it. WCF although is great, it can also be a pain in the ass. When searching through the net, keep in mind always that Internet is not always correct as I have wrote here. I really suspect that many of the blog post although, they can be helping, are not revealing entirely the truth and the disadvantages. I have always been fun of Microsoft Technologies but there is a limit to the indirect advertisement.
Following Instructions
Back to the post subject. Many of you have done what everybody on Internet says. Add a WCF Service and a Service Reference and Great, all is ready and done. Even for debug, every time I execute debug the application, a dummy Debug Host is raised and I can debug the service. All is great? No.
Questions
First of all. What if I’m not running parts of the solution that require the service. Why should I be punished with the overhead of raising the host?
Second and most serious. Has really anyone tried to debug the service, and every underlying class used by it? Has anybody tried to utilize edit and continue, among all these guys who say how great WCF is?
I tried and as you can guess from my attitude, I could not utilize Edit And Continue. When I am developing a big Application, usually there will be at least 2 layers behind the service. Should I restart the application each time? And don’t let me talk about the debug through the dummy client, when an Operation Contract of mine, will use a complex data type. It is just not possible.
So what is the solution?
Easy someone can say, but easier said than done. As you would with .Net Remoting, If the service is located in your output directory, by whatever trick in the solution, then just raise the host programmatically in an address of your choice and then tell the client to hit this address. This way you have always simulating data transferring through WCF channels (very important), and you can of coarse use the feature of Edit and Continue.
The problem is that the dummy service the solution raised keeps coming up, which is very annoying. I haven’t found a solution, mainly because in the framework I’m developing, there is a single Operation Contract handling abstract Message Types. This was another great milestone for me in WCF. I really can’t understand why they have made DataContractSerializer as complicated, and not simple as the one used in plain old fashioned remoting. Having this service in my framework, I do not have in my solution the WCF Service so , there is no penalty overhead from the Debug Host that is raised.
Last Problem
Finally a point of interest which was my last obstacle that took me a half day to find. I had implemented a provider class for the remoting part, which if needed, fired up the service host. Everything worked just great in the test projects, but at some point I tried to extend the framework with WPF.
The trick was that at first request, through static constructor I checked if the service was required to be hosted, and did that. But this did not work when I made the call from WPF. The only error was a timeout exception. I was going crazy, and then it kicked in. Never trust completely a 3 party library.
Solutions
I made three clients, one Console, one Windows one WPF and stripped down the functionality of my framework to test. On each UI Client I made the call (and raised subsequently the host) after a UI reaction. I turns out that neither Windows Forms played correctly, when for example the call is made through a button click event. When I saw that, I made the host come up before the UI part was ever initialized and guess what? It all played just fine.
I really can’t understand how this has not been mentioned.
Conclution
For me WCF is good for the plumbing. It is much more complicated than .Net remoting, really hard to troubleshoot if you are doing something outside the ordinary, which are discussed in all those praising posts and articles. Maybe I haven’t studied it as much, maybe I’m missing something but if the case is true, tell me how something that is advertised as easy and all remoting-problem solving can be this hard to utilize and debug. You will say that WPF, has as much difficult learning curve but WPF is not advertised as the magic trick that the programming world was missing. Since I have read about it, everyone mentioned that it is hard and difficult to adopt, and it is not for all kinds of applications. For me WPF is the star of .NET3.
Despite all these problems I really believe in WCF, because of other great stuff that it supports. Regarding security MS says here that
You should not use WCF Service Host to host services in a production environment, as it was not engineered for this purpose. WCF Service Host does not support the reliability, security, and manageability requirements of such an environment. Instead, use IIS since it provides superior reliability and monitoring features, and is the preferred solution for hosting services. Once development of your services is complete, you should migrate the services from WCF Service Host to IIS.
Having this in mind, I can't stop thinking whether WCF is a great overhead on development, when .NET is remoting is a well tested solution under IIS. But choices have been made, mainly because the new technology I believe is here to stay.
Links
http://sarafianalex.wordpress.com/2008/06/17/wcf-debuging/
Explanation for LINQ to SQL not suitable for LOB
| You must Sign In to use this message board. |
|
|
 |
|
 |
you've got a low grade on your article because you're not a "believer"
I'm starting off (a month now) on Silverlight and WCF and there're just sooo many gotcha's (undocumented gotcha) where most tutorial/doc just tell you how great it is, quoting only simplistic examples but forget to mention many of the problems most developer will run into, for example, 1. Silverlight don't do non-generic collections such as Hashtable 2. [DataMember] don't applies if you mark class [Serializable] not [DataContract] ... and so many more weird problems and surprises...
I once asked a question, what's so great about WCF that Web Service won't provide. Nobody gave anything that's to-the-point and up to now I'm still unsure if WCF has any "killer feature" that its predecessors don't offer.
Anyway, I'm just doing this so our app will be "forward-compatible" and supported in future.
dev
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I totally aggree with you. You can't imagine the hell I've been through, in my last framework update where I need objects inside workflow, to be transfered also through WCF. The first wants Serializable, the Second DataContract. If your object descends from Dictionary then you can't because it implements ISerializable
The only great thing about WCF is that you can have the same interface and expose it through differents ways, like WebService, tcp. You couldn't do that before.It also gives you a great way to host wcf services within a console or service application. It does a great deal of things. But Microsoft says that you sould host wcf services, only under IIS, so what is the point? I will say it again. I firmly believe that at microsoft they believe that their target group programmers are students, who will make an application just to proove a concept. In real bussiness that's not the way. Then again, microsoft has been prooven right(not logically right) with visual basic which had the same concept, and generally with windows.
Returning on the wcf subject,I think that it should be more typed on what you want to do. Configuration should be more splitted, and not so much confusing.
I want tcp then tcp configuration section for wcf. I want wshttp the same. Why should I care about, other settings for other technologies. Most of the bussiness applications expose one, twice the most interfaces for their application server IF THEY EVEN HAVE ONE.
So I really believe that is better to have simplified wrappers, for a common functionality and not an all in one solution that will get worst because simply people will get to the easy solution because of the complexity. That means bogus security and other stuff. Splitting your application functionality requires skill and understanding, but that cannot be the reason for creating and all in one mayem.
Silverlight is great but that is another subject. My only concern is that it allows only wcf communications and web service calls and that your assemblies must be different between silverlight and non silverlight applications.Types that are not supported should be with each version, especially DataSets.
I love .NET, but MS has done some really bad and stupid things in .NET3. Great ideas, very bad implementations.
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
|
 |
|
 |
Sarafian wrote: I love .NET, but MS has done some really bad and stupid things in .NET3. Great ideas, very bad implementation
i feel exactly the same mate, i am very glad i'm speaking to someone who wouldn't tell me "What you see as short coming I see as world of opportunity"! Sometimes I just feel like I'm talking to hollow nothing ... with people like this. I mean, can we be realistic about this? Yea Silverlight is great but I think something like not support .NET modules or Hashtable should be big banner warning in opening doc! WCF gives 10% performance increase fine but I don't think this justify the amount of work it needs to bring old ISeriliable to DataContract compliant (hell, spend some money buy some hardware cheaper is it not?)
Hey mate, I will give a five on the article. Just so it properly reflects there're programmers out there who don't just blindly believe in everything they throw at us.
dev
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Converting authentication remoting service to WCF which was validating if user is already logged in and making sure that the user is actually live (not disconnected). When you ask this question, you get the answer: You should use Callbacks with WCF service but how exactly you should do this is more likely undocumented???
After spending around 2 months I could able to achieve the result I expected but still there is one problem and I could not understand why? I have GUID type of data in DataMember structure but when I generate the proxy it somehow changed to string and surprisingly it still works as expected (magically box and unbox!!!)
In summary, WCF is cool and gives the power you need in most situation but to implement as desire is much more than in the theory....
Cheers, Binoy
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I can't understand your problem. But seems something I will be facing so can you elaborate please. Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi
I was trying to achieve following using WCF: - Checking new user if already connected with the same ip and user id? - While checking this, if User found in the connected user collection then ping the user (sometimes due to some crashing or loosing the network connection, connected user collection goes out of sync) and if ping does not get reply then remove it from the collection and allow the new user for authentication - Then its simple, validate user using some business logic and give token (GUID) to the user
but it took around 2 months for me to identify how to ping correctly and find out if user is already connected or not using WCF/Win forms
let me know if you need technical info
Thanks, Binoy
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I liked your post. It shared a similar tone I was carrying around for the past few months. The app I am working on was using WCF for all data access. After over a half-a-year of headaches, last week we gutting all WCF Services.
Now I'm happy.
We brought our project down from 1300 code files to a mere 600 code files and doubled performance.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have created the framework in a way that it will be very easy to get rid of WCF if needed.
One thing I strongly disagree is to put everything in one component. In most cases, only a portion will be used, and all the overhead around the whole stuff just makes it too difficult.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|