Freigeben über


WCF Deployment Challenge

Join me as once again I tackle the learning curve of WCF with a deployment challenge.  Today - WCF vs. ASMX deployment.

Note: As the new WCF evangelist I have to say that WCF is clearly the future of web services.  In fact, the WCF team owns the ASMX stack and is maintaining it but the future direction is headed the WCF way.   You should know that.

The challenge:

  1. Create and test a simple Hello World service on the dev machine
  2. Deploy it to an intranet server
  3. Deploy it to a hosted internet server

I want to learn what it takes to do this with ASMX and WCF.  Let's see how successful we can be. 

Round 1: Create and test a simple Hello World service on the dev machine

ASMX

This is a snap.  I start VS 2008, choose File / New Web Site / ASP.NET Web Service and hit F5.  Now I can test my service through the browser interface.  Hello World!

Time to successfully testing my newly created service on the local machine? 2 minutes.

WCF

Same process here, VS 2008 then File / New / Web Site only this time I choose WCF service.  Project opens... I hit F5 and... I get a page telling me to build a client app and generate a proxy using svcutil.exe.  Oh great...  What about WCFTestClient?  I'm going to give it a go instead.  If you are not familiar with this beauty check it out.  You can find it at C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe.  In fact I added it to my external tools in VS so I can quickly launch it.

I copied and pasted the service address from the page telling me to build a client.  This is the argument to the WCFTestClient so in my case the command would be

WCFTestClient https://localhost:40520/WCFService1/Service.svc?wsdl

image

Time to successfully testing my newly created service on the local machine? 3 minutes.

And the winner is?  ASMX

Yes - it is a minor victory to be sure but a victory never the less because after you hit F5 you don't need anything else.  You don't get a page telling you to build a client (that page really ought to provide you with a link to the WCFTestClient app - that would be a victory for sure.

3 things that we really ought to do better with that little page (and yes I sent this feedback to the product team just now...)

  1. Tell people to use the WCF Test Client - this is way better and faster than writing your own test client. 
  2. Tell people to open a VS 2008 command prompt - if you run svcutil or WCFTestClient from a plan command prompt that isn't going to work.  Of course you should know that but sometimes people get stuck on dumb stuff like this.
  3. And we ought to include links to the documentation for these utilities right on the test page.

Conclusion

Ok... let's just admit that you ought to be learning and using WCF.  Some things about it are a little harder than they were with ASMX.  But with great power comes great responsibility right?  I'm clearly no expert on WCF (yet) but I'm planning on becoming one so why don't you join me in this quest.

Comments

  • Anonymous
    March 27, 2008
    A quick question - how do you do something similar to <authorization/> restriction in asmx with WCF? I have looked all over but could not find an answer. I have a bunch of asmx services that I want to migrate to wcf.

  • Anonymous
    March 27, 2008
    Good question - I'll look into that.

  • Anonymous
    March 27, 2008
    The comment has been removed

  • Anonymous
    March 28, 2008
    Ok - I agree and disagree at the same time.  Sure anything that is truly useful and powerful will have some sharp edges that you have to be careful with.  But when some small trivial change makes you successful with a technology on your first attempt - that is important.  We want people to use WCF it is the future.  We want people to be successful as they move toward it.  I'm not suggesting we dumb it down or remove any of its powerful features.  Quite the contrary - beef it up, but lower the learning curve.

  • Anonymous
    April 01, 2008
    I can start the WcfTestClient and it finds and lists my test service, but when I double-click the GetData method I received the following dialog: "Assembly Microsoft.VisualStudio.VirtualTreeGrid, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f7f11d50a3a was not found. Reinstall the assembly or Visual Studio. The application cannot continue and will exit" I am using Vis. Web Dev. 2008 Express Edition? Any clue? Anthony

  • Anonymous
    April 02, 2008
    The WCF test client uses a new tree grid control.  Somehow it can't find it on your system.  You might try reinstalling.

  • Anonymous
    April 02, 2008
    I think it's not being installed with the express edition.. Which means that the tool exists but is not usable

  • Anonymous
    April 04, 2008
    In VS2008, if you use WCF Service Library project template, and press F5, WcfTestClient will automatically be launched. WcfTestClient isn't supported with the Web Dev Express edition of VS 2008.