使用wcf服务执行Asp.net应用程序时显示错误 [英] Error displayed when executing Asp.net application with wcf service
问题描述
我开发了包含wcf,linq到sql的代码的Web应用程序.在Wcf服务中,类代码如下:
Hi,
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;
}
在这里,FirstGuardian是一个包含属性UserName,Pwd的类. DBDataContext是包含数据库表fg0au000s的linq to sql类.
现在我添加了wcf服务参考,并在default.aspx.cs中编写了一个代码,例如:
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.Vidya();
GridView1.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
现在我执行了应用程序,但出现错误,如下所示:
在http://localhost:1047/vidyawcf/WcfService.svc上没有侦听终结点的端点可以接受该消息.这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参见InnerException(如果存在).
注意:Wcf服务代码和客户端访问代码在同一应用程序中均可用
谢谢,
Vidya.k
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
Thanks,
Vidya.k
推荐答案
在下面的链接中关注该解决方案.
错误:没有端点在监听... [ ^ ]
Follow the solution in the below link.
Error: There was no endpoint listening at...[^]
这篇关于使用wcf服务执行Asp.net应用程序时显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!