Friday, February 11, 2011

WCF Web Services The Easy Way

In fact, we are going to setup WCF web services without any configuration!
To make it even more simple, you could move the code for the service out of the CodeBehind file and into the .svc file. Now you have an entire WCF service in a single file! Check it out:

<%@ ServiceHost Language="C#"
Factory="System.ServiceModel.Activation.ServiceHostFactory" %>
using System.ServiceModel;

namespace MyTestWebsite
public class MyTestService
public string DoWork()
return "Did Something!";

No comments:

Post a Comment