What is wrong with adding a service reference when using WCF in Silverlight?

This article talks about consuming WCF services in Silverlight, but states:

There will be no proxy servers, no generated codes, no third-party utilities and no disgusting use of the “Add service link”.

What is wrong with me adding a service link in my Silverlight project? Is there any hidden overhead? Or is this the case of Fear Of Auto Magic by the author?

+4
source share
2 answers

The rationale for this statement from the author is as follows:

To get started, let me start by reminding everyone that you should never use the “Add Service Link” in Visual Studio to create a magic service. The code is incredibly detailed, difficult to manage, changes are rewritable and almost always used as an excuse not to learn WCF. There are a few things that are worse than dealing with people who know the product, simply because they know how to use the mouse.

As someone who relied on “Add Service Link” in Silverlight, I find this to be a little higher. I agree that the automatically generated code is verbose and cannot be edited because it will be overwritten. However, as far as manageability goes, it does not become simpler, in response to a change in my service, it takes one click to return the link to the service back.

Despite this, I think the article is very good, and I can guarantee that the ease of adding links to services prevents me from delving deeply into WCF. This is not necessarily bad, because at the end of the day, WCF works in plumbing, and I'm interested in writing an application that does not become a WCF expert. Be that as it may, I have reached a point where I encounter some serialization issues between Silverlight and my service, which I suspect are browser related. I need to dig deeper into WCF to figure it out, and this article looks like an ideal starting point.

The “Add Service Link” has been wonderful for me for 1.5 years, and although there are benefits to learning about the internal components of WCF, of course, there’s definitely nothing wrong with quickly and simply selecting a point and clicking to start with in visual studio.

+3
source

"Adding a Service Link" in Silverlight has some problems right now ... the configuration file is restored every time the service is updated.

This is a little further than the “auto-drive” that people emphasize as a problem. Firstly, with a link to a service, you are “tied” to the service and its methods that it provides. If you re-generate the service, the client must do the same. Creating a service dynamically fixes this problem. In addition, with abstraction / reflection / dependency injection, you now have unlinked service links.

I don't think service links are bad, but WCF and web concepts are moving away from it. For example, WCF REST standards do not have the "service link" you consume ... its URL-only routing tables. More and more people are recommending this as a standard, for example, Yuval Lowy (idesign.net and author of several WCF books) also recommends not using service links.

+2
source

All Articles