views:

49

answers:

2

can we use WCF in Asp.net MVC and how can we use?

+3  A: 

Sure you can - you need to learn the basics, e.g. from this site here:

 http://msdn.microsoft.com/WCF

I can't possibly explain all you need to know here - go and learn the basics of WCF, and if you have concrete problems / questions, come and ask them here!

marc_s
Another good article with a decent example is http://www.codeproject.com/KB/aspnet/aspnetmvc_bugtracker_v4.aspx
Tom Cabanski
A: 

Do you mean, can my ASP.NET MVC projects be WCF clients, or contain WCF servers?

If the former, sure no problem. Right click on Solution Explorer, 'Add Service Reference', enter the URL to a running service (or pick an existing one from within another project in your solution) and away you go.

If the latter, that's fine as well. There is nothing stopping you from adding a WCF service via (perhaps SomeService.svc) 'Add\New Item...' (WCF Service, AJAX-enabled WCF Service, or Silverlight-enabled WCF Service are your options) or by hand. You need to bear in mind that the WCF service in this case will be hosted in IIS so there are some restrictions you need to be aware of depending on which version of IIS you are deploying to (ie. in IIS 6 only HTTP protocols are supported for your WCF services, some of the more esoteric WCF options may also be limited).

James Webster