When I try to use WebOperationContext.Current in a WCF project, the Current is null. Below is the example. Could anyone please shed a light on it?
WebForm - default.aspx:
ServiceClient sc = new ServiceClient();
Response.Write(sc.DoWork(1) + "<br />");
WebOperationContext c = WebOperationContext.Current; --Current is null
//WCF Interface
[ServiceContract]
public interface IService
{
[OperationContract]
[WebGet]
int DoWork(int num);
}
//WCF Implementation
public class Service : IService
{
public int DoWork(int num)
{
return num;
}
}
System Settings: ASP.NET 3.5
Thank you in advance.