tags:

views:

375

answers:

5

I have an opportunity here to get into WCF but have a limitation on time on deliverable. I can provide my services in iteration and if WCF is the way to go I can buy extra time to get over the learning curve.

What is the norm now? Is WCF the way to go?

+6  A: 

I've run into this question a few times now, so from my own experience and others, go with WCF only if you're willing to take on the learning curve. Creating the objects is a no brainer, really straight forward and easy to use. But...

Some common pitfalls:

  • The default binding is wsHttpBinding which is secured by default. If you're wanting to go with something more traditional, use the basicHttpBinding.
  • If you're hosting in IIS, make sure to set the host header or the xsd uri references will all be to localhost or the server name.
  • Use the WCF Configuration Utility, it will help a lot when you're configuring your endpoints.
Joshua Belden
+1 for the note on wsHttpBinding. That tripped me up.
Jim G.
+1  A: 

If your service need to be available over multiple communication protocols and you need to configure security, WCF is the way to go.

If the service just needs to be available over HTTP and/or HTTPS, ASMX web service would be the way to go if you have a time constrain

Michael Kniskern
+4  A: 
  • Microsoft has said that WCF is the replacement for Web Services.
  • Replacing web services will WCF services is not particularly difficult once you learn the basic syntax.
  • WCF services offer everything that Web Services do plus allow you to deploy the same component in other contexts - you can deploy your component as a web service or stick in in a windows service to offer the same functionality to other software, or slap it in-process with any of your other code - without ever having to change the code inside the service.
  • WCF can be configured to offer better security.

Seriously, grab a copy of Juval Lowy's excellent "Programming WCF Services" and read the first chapter. Create a few services and pretty soon you're realize it's not as difficult as it seems at first glance.

WCF is the future of components in .NET. Web Services are the past.

Terry Donaghe
A: 

Once you get WCF setup, its fantastic! Using SQL & LINQ via WCF to return your data is (for me) SO much quicker!!

One thing of note: Certificates!

We had a lot of issues there! This link helped.

Good luck!

Christian Payne
+3  A: 

This should be a no-brainer. Too bad it isn't.

The answer is WCF. It replaces the old ASMX web services. It's no longer accurate to say that WCF is the future - it's the present, and ASMX is the past, rapidly becoming ancient history.

The subset of WCF that you need to learn to do the same as you were doing with an ASMX service is really very easy.

  1. You don't need to know any binding by basicHttpBinding. Using this, your client programs can even continue to use Web References.
  2. You need to learn not to worry about the details of the XML your data contracts are being serialized to.
  3. You need to learn that the only parts of a DataContract that will be serialized are those marked as [DataMember]. It's an "opt-in" model instead of the "opt-out" model you had with the XML Serializer.
  4. You need to learn to define the contract of your service with an interface marked with [ServiceContract]
  5. You don't need a [WebService] class, but simply a class that implements your [ServiceContract] interface.

That's about all, really. You'll learn it very quickly. The rest of it is "gravy". It's a very rich gravy, with a lot of "meat" in it, but you can leave it on the side, or just take a little if you want it.

John Saunders