Hi,
I developed web application that contains code with wcf, linq to sql. In Wcf service class code looks like:
public List<FirstGuardian> Vijay()
{
List<FirstGuardian> list = new List<FirstGuardian>();
DBDataContext db = new DBDataContext();
var v = from i in db.fg0au000s select new { i.Username, i.Password };
foreach (var i in v)
{
list.Add(new FirstGuardian
{ UserName = i.Username,
Pwd = i.Password
});
}
return list;
}
Here FirstGuardian is a class that Contains Properties UserName,Pwd. And DBDataContext is a linq to sql class that contains database table fg0au000s.
now i added a wcf service reference and i wrote a code in my default.aspx.cs like:
try
{
ServiceReference1.WcfServiceClient obj = new ServiceReference1.WcfServiceClient();
GridView1.DataSource = obj.Vijay();
GridView1.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
Now i executed application i am getting error Like below:
There was no endpoint listening at http://localhost:1047/vijaywcf/WcfService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Note:Both Wcf Service Code and Client Accessing Code available in same application
Thanks,
Vijay