In this article I am going to explain how we show data in a MVC application using WCF service.
Create a WCF Service Application.

Image 1.
Now right click on Solution Explorer -> Add New Item

Image 2.

Image 3.
Click New Connection -> Select Server Name -> Provide Authentication -> Select Data Base -> OK

Image 4.

Image 5.

Image 6.

Image 7.
Now Open Iservice1.cs file
Remove GetData() and GetDataUsingDataContract() method. Now Iservice1.cs should be like below, I added a new Interface GetEmployee().

Image 8.
Now Open Service1.svc.cs file
Remove GetData() and GetDataUsingDataContract() from here and implement GetEmployee() interface here.

Image 9.
Now Run the application.

Image 10.
Now Create a MVC 4 application Name as MyMVCAppWithWCF

Image 11.

Image 12.
Now Right Click on Solution Explorer -> Add Service Reference.

Image 13.

Image 14.
Now Right Click on Controller -> Add Controller

Image 15.
Now in Index do the following code:

Image 16.

Image 17.
Our VIEW is:
@model IEnumerable<MyMVCAppWithWCF.MyWCFService.Employee>
@{
ViewBag.Title = "Showing Data In MVC 4 using WCF Service";
}
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.City)
</th>
<th>
@Html.DisplayNameFor(model => model.Country)
</th>
<th>
@Html.DisplayNameFor(model => model.Dept)
</th>
<th>
@Html.DisplayNameFor(model => model.Emp_ID)
</th>
<th>
@Html.DisplayNameFor(model => model.Mobile)
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.State)
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.City)
</td>
<td>
@Html.DisplayFor(modelItem => item.Country)
</td>
<td>
@Html.DisplayFor(modelItem => item.Dept)
</td>
<td>
@Html.DisplayFor(modelItem => item.Emp_ID)
</td>
<td>
@Html.DisplayFor(modelItem => item.Mobile)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.State)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
</td>
</tr>
}
</table>
Now Run the application. . .

Image 18.