Click here to Skip to main content
15,746,248 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:

I developed web application that contains code with wcf, linq to sql. In Wcf service class code looks like:
public List<firstguardian> Vidya()
    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:

            ServiceReference1.WcfServiceClient obj = new ServiceReference1.WcfServiceClient();
            GridView1.DataSource = obj.Vidya();
        catch (Exception ex)

Now i executed application i am getting error Like below:

There was no endpoint listening at http://localhost:1047/vidyawcf/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

Updated 14-May-12 23:36pm
sagar wasule 15-May-12 5:58am    
Is ur FirstGuardian class defined as DataContract ??
viddlov 16-May-12 6:47am    

1 solution

Follow the solution in the below link.

Error: There was no endpoint listening at...[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900