20

I have 2 web services with about 6 web methods in total, most of the code is ofc sitting in assemblies any way, and the web service asmx is really just calling these assembly methods and returning their return type.

How much effort is it to convert the web services from ASMX to WCF?

I pretty much at this stage control the only - non web based clients connecting to the web services, so this is not really a problem, product is in prelaunch.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
JL.
  • 78,954
  • 126
  • 311
  • 459

2 Answers2

18

Check out some of those blog posts and articles on how to do it:

and many more - search for "Migration ASMX to WCF" and you'll get a ton of hits

Marc

Sandy
  • 11,332
  • 27
  • 76
  • 122
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
12

You should find it extremely simple to convert - especially if your existing asmx web methods are just calling into other classes. Just create a new WCF Service from Visual Studio - that way you still have your existing web services intact. It will automatically create an http end-point for your so you can just dump it straight into IIS (with a little configuration). You will need to describe your DataContract classes but that it trivially simple too.

I did this recently and it was a joy!

Chris Arnold
  • 5,753
  • 5
  • 35
  • 55
  • 11
    Having actually done it - I wouldn't call the overall effort extremely easy. But I am glad you sold it as being easy - or else I might have not even tried. I have to make the following recommendations to those willing to make the switch. 1... You're going to loose out on the http test form, and will need to install a seperate test client, 2 - You will need to learn how WCF slots together, and the configuration can be overly complicated. 3... You're going to need to watch what type of errors you throw back, SOAP exceptions just won't cut it. 4... Its tricky keeping an http context. – JL. Oct 05 '09 at 17:41
  • 2
    It's true that you lose the web service test page, but you gain (for free) the WCF Test Client which is infinitely better :). – Chris Arnold Oct 05 '09 at 19:20