banner



How To Consume Wcf Service In Mvc 5

  • Updated date January 07, 2015
  • 87.7k
  • ane

In this article, I am explicate how to use a WCF service in MVC five.

Right-click on Solution Explorer and add together a new project.

Select ASP.Cyberspace Web Application with .Internet Framework 4.v.

Web Application

Select Empty MVC Template.

MVC Template

Your MVC project volition be added to the Solution Explorer.

Now showtime copy the WCF service URL. (Please commencement check previous article here.)

copy wcf service url

Now an EmployeeService service reference is added to your WebApplication.

WebApplication

Now right-click on the Employee service and click on Configure Service Reference.

Configure Service Reference

Now uncheck Reuse type in referenced assemblies and click OK.

 referenced assemblies

Add a New Controller to the MVC application.

Controller

Now add together the post-obit code to the Index activeness.

code

Right-click on the Action method and Add View.

Add View

Now Select Template List and Model class.

Model class

Your View code will look like this.

View code look

Now run the application (Ctrl + F5).

Run Application

How To Consume Wcf Service In Mvc 5,

Source: https://www.c-sharpcorner.com/UploadFile/b07128/how-to-use-wcf-service-in-mvc-5/

Posted by: hickstung1962.blogspot.com

0 Response to "How To Consume Wcf Service In Mvc 5"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel