.NET Zone is brought to you in partnership with:

Located in Raleigh, NC, Imaginovation is a premium web development and design company with a passion for the online capability. Founded in 2011, Imaginovation's educated and experienced team utilizes the latest technologies combined with well-developed strategies to provide its customers with quality marketing and communications products that are both accomplishing and affordable. Imaginovation have mastered their capabilities in research and analysis, marketing, design, development, programming and maintenance, which are carefully combined and applied uniquely to each business. With cutting edge technologies and the passion and motivation to continue to update and innovate, the Imaginovation team offer websites, applications and other online solutions that guarantee affordability, quality and results. Michael has posted 21 posts at DZone. You can read more from them at their website. View Full User Profile

WCF Service Application Documentation 2012

12.17.2012
| 3902 views |
  • submit to reddit

   •   Purpose
Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.

   •   Scope
This document covers technical details for creating Windows Communication Foundation (WCF) service application.

2: Steps for Creating WCF Service

2.1 Create WCF Service Application
   •   Open visual studio 2008(and above) and select new->Project->Visual C# -> WCF Service Application. 


Give service name and click OK
   •   It will create one class i.e.  ServiceName.svc.cs  and interface i.e. Iservice.cs
   •   Add the method and logic as per user requirements within a class ServiceName.svc.cs 

2.2 Browse Service to get Service address

   •   Run or browse the Service Application to get the service address. It will appear following screen
   •   Click on service (here service name is transaction.svc) to get the service address.

2.3 Add service reference in web app

   •   Right Click on web application and select Add Service Reference


   •   Add service reference in address field and click OK
   •   Now you can use WCF service in your application.

3.  WCF Service Details:

3.1 WCF Service working:

In WCF service, user sends request through application and WCF service process that request and send response back to user application. Above figure shows WCF Service working.

WCF services are hosted using 3 different ways. They can be hosted in IIS or self-hosted or in services. WCF services are platform independent so they can be used in any programming languages. WCF services are easy to implement and access than soap services.

This article was written by the Imaginovation team.  They are a Raleigh web design and software development company who uses .NET, PHP, HTML5, JavaScript, and jQuery technologies.

Published at DZone with permission of its author, Michael Georgiou.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)