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:
- Create and test a simple Hello World service on the dev machine
- Deploy it to an intranet server
- 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 http://localhost:40520/WCFService1/Service.svc?wsdl
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...)
- Tell people to use the WCF Test Client - this is way better and faster than writing your own test client.
- 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.
- 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.