Introduction

This article explains how to create a simple WCF service using the scenario of our applications often requiring code to determine the number of days, such as how long the customer is associated with us, also to convert from a date of present days into days or years and so on.

Building the Sample

The requirment of building this sample you need visual studio 2010 and knowledge about C# language.

Description

Windows Communication Foundation (WCF) is communication sotware between applications of different platforms or the same platform over the various protocols such as TCP, HTTP, HTTPS and so on

 

C#
Edit|Remove
Click here to add your codusing System;   
using System.Collections.Generic;   
using System.Linq;   
using System.Runtime.Serialization;   
using System.ServiceModel;   
using System.ServiceModel.Web;   
using System.Text;   
   
namespace AgeCalculatorService   
{   
      
    public class CalculateAge : IService1   
    {   
   
        public int calculateDays(int day, int Month, int year)   
        {   
            DateTime dt = new DateTime(year, Month, day);   
            int datetodays = DateTime.Now.Subtract(dt).Days;   
            return datetodays;   
        }   
   
    }   
   
}   e snippet.

More Information

for more information please my website www.compilemode.com and refer article Creating WCF Service