views:

123

answers:

1

First off, i'm fairly new to programming, I've built a few asmx web services but I am a little lost regarding how I should set up a WCF web service. I've tried to research this over the past couple days by reading through a lot of the documentation/articles/videos on MSDN but I'm still a confused.

Since my current web services are hosted on a separate box using IIS, from what I understand I need to create a WCF Library, then reference the Library in another WCF App and then host that app in IIS and reference the WCF App from my Front End? Seems like an extra step to me...? Not to mention a pain when developing on my local box.

Any advice or a point in the right direction would be very much appreciated. Thanks!

+2  A: 

WCF gives you the option of sharing common assemblies (i.e. so both your service and clients can use the same domain model library), but it's not a necessary step.

You can host a WCF service through ASP.NET, same as ASMX. The "WCF Service Application" project template in Visual Studio configures it this way by default - as a WCF service hosted in IIS.

For the most common scenarios, it's really no different from ASMX. You create a WCF Service application, deploy it to a web server, and add service references in client applications. The importer will automatically generate classes for you, so you don't need to reference any assembly. No extra steps.

If you haven't already, you really should have a look through Microsoft's Tutorial. You'll find the steps very similar to those for setting up an ASMX-based architecture.

Aaronaught
Hmm ok. I guess I was getting confused on creating the client interface for the service using the meta data so I could test the service.
Jisaak
For instance, when I use the dll template the service's client has alot more options regarding endpoints and bindings and much much more. Why does the WCF Application template not included all these options?
Jisaak
@Jisaak: What "dll template?" I'm not sure what exactly you're asking; yes, WCF has many more options for bindings and endpoints than ASMX did, but importing a service reference is still pretty much automatic, just use the "Add Service Reference" wizard like you used to use the "Add Web Reference" one.
Aaronaught
Oh sorry, I meant the library template. If I right click on the config file it gives me an interface with a bunch of options, but under the Application template if I right click on the config file I get a very limited number of options and info.
Jisaak