Asp.net mvc asp.net mvc wcf错误
我正在从事asp.net wcf项目。尝试渲染视图时出现此错误。 我的控制器Asp.net mvc asp.net mvc wcf错误,asp.net-mvc,wcf,Asp.net Mvc,Wcf,我正在从事asp.net wcf项目。尝试渲染视图时出现此错误。 我的控制器 public ActionResult Index() { AdminService.AdminServiceClient adminsvc = new AdminService.AdminServiceClient(); List<COUNTRIES> lstRecord = new List<COUNTRIES>();
public ActionResult Index()
{
AdminService.AdminServiceClient adminsvc = new AdminService.AdminServiceClient();
List<COUNTRIES> lstRecord = new List<COUNTRIES>();
var lst = adminsvc.GetAllCountries();
foreach (var item in lst)
{
COUNTRIES country = new COUNTRIES();
country.COUNTRY_ID = item.COUNTRY_ID;
country.COUNTRY_NAME = item.COUNTRY_NAME;
country.COUNTRY_CODE = item.COUNTRY_CODE;
lstRecord.Add(country);
}
return View(lstRecord);
}
public ActionResult Index()
{
AdminService.AdminServiceClient adminsvc=新的AdminService.AdminServiceClient();
List lstRecord=新列表();
var lst=adminsvc.GetAllCountries();
foreach(lst中的var项目)
{
国家=新国家();
country.country\u ID=item.country\u ID;
country.country\u NAME=item.country\u NAME;
country.country\u代码=item.country\u代码;
1.添加(国家);
}
返回视图(记录);
}
Web.Config
项目概述描述您所遇到的错误,但是webconfig中的WCF服务端点配置中没有提供地址。请验证并包括服务终结点的地址
<endpoint address="http://www.someaddress.com/someaddress" ...
将服务元素更改为:
<service name="BPP.CCSP.Admin.Services.AdminService" behaviorConfiguration="restbehavior">
<endpoint address="" binding="webHttpBinding" contract="BPP.CCSP.Admin.Services.IAdminService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
阅读,将实际错误作为文本包含在问题中,尝试搜索错误并展示您的研究成果。这个错误以前已经在数百个问题中讨论过了。