4

Recently a couple of WCF services have been introduced to our company's API. There are sample implementations for Windows that make use of proxy codes generated by Visual Studio 2010 (either full WCF client or Silverlight code). All looking nice.

Then I figured out that it is also possible to let Studio generate a Webservices 2.0 client code proxy and what can I say:

  • It works just as fine as the WCF client
  • It also returns real objects, just like WCF
  • It is also using SOAP

What the heck is the difference/advantage of a native WCF client?

Please note that I'm especially interested in the CLIENT SIDE. The server side is a different story. The point is: why would I connect to a WCF server using WCF client code if Web Services client code works as good?

I can also ask with regards to MONO: WCF support in Mono is far from being perfect, while WebServices 2.0 are woking pretty well. So after fighting with WCF for a while I switched back to a WS 2.0 client code proxy and have not noticed any issues so far. Are there problems I will have to expect?

Krumelur
  • 32,180
  • 27
  • 124
  • 263

2 Answers2

4

Flexibility.

Today, you're hitting that service via HTTP. Tomorrow, you might want to add some persistance and hit it via MSMQ. Using WCF that's a configuration change - using Webservice client code you're looking at a complete rewrite of that area of your code.

mavnn
  • 9,101
  • 4
  • 34
  • 52
  • But if I stick with HTTP, the "features" are the same? Or is there something I cannot do that I can with WCF? – Krumelur Jan 23 '12 at 13:17
  • 1
    Not that I'm aware of; you can build the xml by hand if you want! Your added concern about Mono support does raise an interesting twist. WCF gives more flexibility dealing with Windows .net clients, but if you need interoperability with other systems (Java, .net, whatever) your server better expose a standard http(s) binding as well as anything fancy! – mavnn Jan 23 '12 at 13:24
3

Another benefit is the ability to turn on tracing, message logging and diagnostics with nothing more than a configuration change.

See Administration and Diagnostics, which says

Diagnostics Features Provided by WCF

WCF provides the following diagnostics functionalities:

  • End-To-End tracing provides instrumentation data for troubleshooting an application without using a debugger. WCF outputs traces for process milestones, as well as error messages. This can include opening a channel factory or sending and receiving messages by a service host. Tracing can be enabled for a running application to monitor its progress. For more information, see the Tracing topic. To understand how you can use tracing to debug your application, see the Using Tracing to Troubleshoot Your Application topic.

  • Message logging allows you to see how messages look both before and after transmission. For more information, see the Message Logging topic.

  • Event tracing writes events in the Event Log for any major issues. You can then use the Event Viewer to examine any abnormalities. For more information, see the Event Logging topic.

  • Performance counters exposed through Performance Monitor enable you to monitor your application and system's health. For more information, see the WCF Performance Counters topic.

John Saunders
  • 160,644
  • 26
  • 247
  • 397