Tutorial on consuming WCF 4.0 with Asp.net in Vs2010 - wcf

I want a good tutorial with WCF on VS2010. This service will be consumed in an ASP.Net Mvc 2/3.
The development will be done in VS2010.
This is a good start, but still not exactly what I need.
Can anyone recommend a good tutorial?

The link you have provided is very good, it has shown all the steps of creating and consuming WCF service. The only difference in your case is, the client. You want consume WCF service in ASP.Net MVC, and in the tutorial the client is console app.
Following are some of the links which might help you
Scott Guthrie's Nerd Dinner walkthrough to get a really good understanding of MVC basics.
How to Configure wcf service programatically
Blogs on how to write a Layered ASP.NET MVC Applicaiton with a WCF Service
Part I (General Concepts)
Part II (Building a Repository)
Part III (Building The Service)
Part IV (Using The Service)
Hope this helps you.

Related

What framework should I choose to build a WCF Restful API

I am wanting to build a Restful API using WCF however I am struggling to make a decision on how to accomplish this.
The WCF Rest Starter Kit was developed for .Net 3.5 and has not progressed past Preview 2. Although it can be used within the current .NET Framework and within Visual Studio 2010 it seems from my research to be dead in the water and superseded by the new WCF Web API which is currently in Preview 5.
On the other hand the WCF Web API is only at preview stage and should not really be used in a production application as many things could possibly change before its release. There is also no indication if its nearing completion and if it’s going to be in the next .NET Framework release and when that is intended to be.
I find myself between rock and a hard place and look to the wider community to provide me with some guidance on this if at all possible.
You should regard this tweet from Glenn Block.
Using ASP.NET MVC for building a Restful API should be straight forward and easy way to do it.
However I've used WCF Web Api with WCF Rest Contrib in production without any problems.
See
Creating REST API with ASP.NET MVC that can speak both JSON and Plain Xml
RESTful Services With ASP.NET MVC
ASP.NET MVC – Create easy REST API with JSON and XML
Maybe OpenRasta is what you are looking for?
See also
RESTful framework alternatives to WCF
I depends on your application. If its a Website (also has views) that offers the REST API using ASP.NET MVC would be less technology, less effort, less know-how etc.
If its JUST an REST API choose what you like more from development style: ASP.NET MVC or WCF Web API

Do we need Web Service working experience to learn/work on WCF for web application?

I have not worked on Web Services, but now I am planning to work on WCF Services in my next web application project. Do we need to have prior working experience on Web Services to work on WCF ?
can we start learning/working on WCF directly with out working experience in Web Services ?
You do not need any prior experience in web services to use WCF, though it would of course help in some situations. Having said that, WCF does have a learning curve (like everything), so you should consider going through some training, like the excellent Pluralsight training.
In addition to some sort of training, a must have resource for WCF in my opinion is Juval Lowy's book, Programming WCF Services.
Good luck!
What do you mean by Web Services? Do you mean ASP.NET Web Services (ASMX)? If so, you don't need experience with them to learn WCF.
WCF is API for creating web services (and remote services generally) so once you start learning WCF you will start learning how to create and work with web services.
I think yes. It should not be a problem to write a WCF service even if you do not have web service development background. At least, I did not have this experience at the beginning :). I have posted a link to good WCF book at:
Recommended beginner's learning resources for WCF

Hosting WCF Rest Services in WPF Application

Hi i have some REST services created with WCF Rest Started Kit and i need to host these services in a WPF app. can someone point in the right direction?
There's a really good project in Codeplex called "WCF Guidance for WPF developers" which has white papers, articles, mini screencast to show you a lot of ways to use and leverage WCF if you're a WPF developer:
http://wcfguidanceforwpf.codeplex.com/
Not sure if they have anything on REST webservices - but go have a look!
For a series of intros to WCF REST Starter Kit services per se, go see the Pluralsight web site and their screencast series - excellent resources!
http://www.pluralsight.com/main/screencasts/default.aspx
Basically, hosting a WCF REST service in your WPF app is no different from hosting any other WCF service, so I do believe all the excellent Pluralsight screencasts on hosting your own service should definitely give you a heads-up on how to proceeed!
Marc

Tutorial on Consuming a WCF service in ASP.Net web site?

I'm attempting to create my first WCF service.
I've created the service and now I'm trying to call it from a asp.net (vb) web site and I've tried adding a web reference to it and using the scvutil.exe to consume the service.
So far neither have worked. It's not letting me declare the service in my code. If someone could point me to a good tutorial on how to consume a WCF service in an ASP.Net web site that would be great.
I've found numerous on how to use them with AJAX or silverlight or windows apps but nothing on using it in just a plain old website.
Please see Beginner's Guide to Windows Communication Foundation. It's part of the WCF Developer Center on MSDN, which is full of good resources.
The link above is broken. Some other links I've found while searching for it:
Developing Service-Oriented Applications
Windows Communication Foundation
Conceptual Overview
Getting Started Tutorial
How to: Create a Windows Communication Foundation Client
Basic WCF Programming
Just add service reference, use the service reference as using "reference1.xxxx" and then use the client code.
That's all after the initialization. It works for me. Let me know if you require any help.

Updating my Model in MVC pattern to WCF REST - Services Layer Implementation

I have a MVC pattern in place where I have been developing WinForms and WebForms against. Now, I would like to move onto Silverlight and thus need to 'web services'-enable my Model layer.
Where do I start? I can't seem to find any good resources. Many talk about EF or ADO.NET Data Services. What do I need to do to my Model layer to enable it for WCF REST?
There are many approaches you can take to build your server-side
ADO.NET Data Services - here is some documentation
ASP.NET MVC - if you do decide to use ASP.NET MVC, then this tutorial shows you how to access the service from Silverlight. Essentially Tim is showing you how to access the particular REST service exposed by ASP.NET MVC, but the same techniques (WebClient, etc) can be used to talk to any REST service
Build your own WCF SOAP-based service which implements the MVC pattern. This link shows you how to build and access WCF SOAP-based services in Silverlight.
Build your own REST service which implements a MVC pattern. There is a universal way to comsume any REST service from Silverlight, which is described here. To build the rest service you can use whatever platform you choose. You may consider the WCF REST support that comes out-of-the-box in .Net 3.5, or the WCF REST Starter Kit, which builds on the out-of-the-box REST support in WCF to give you some extra features. Or you can consider any other REST service framework of your choosing.
If you are going to proceed with the technologies you are talking about then forget completely about the term REST. What these technologies allow is you to do is object remoting over HTTP with the HTTP verbs. There is nothing wrong with that, just be aware of what you are trying to achieve.
The more you read and understand about REST the more confused you will get while trying to use Silverlight 3, ADO.Net Data Services, WCF REST Starter kit. These are all fine technologies to achieve what they were designed to do. Unfortunately, you will not learn how to do REST properly from these tools.
If you really want to do REST in .Net then start looking at OpenRasta.