- Open Visual studio 2008
- Create new project from File --> New --> Project

- Create WCF service Application
- Select Web project types under project type section
- Select WCF Service Application to create the WCF service project
- Save the application in your local drive

- After creating the project the following files will be created in the solution.

- Open service interface file (IService1) and delete the automatically created code.
- Copy below mentioned code in IService1 file.
namespace WcfService1
{
[ServiceContract]
public interface IService1
{
[OperationContract]
int GetAddResult(int value1,int value2);
}
}
- Open service svc file (Service1.svc.cs) and delete the automatically created code.
- Copy below mentioned code in Service1.svc.cs file.
namespace WcfService1
{
public class Service1 : IService1
{
public int GetData(int value1,int value2)
{
return value1 + value2;
}
}
}
- Browse the WCF service application in internet explore
- Create service methods will appear in the internet explorer as shown in the below screen capture
- Note down the WCF service URL to add the web reference in mobile application.

3 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.











Gohil JayendrasinhPosted May 5, 2012, 9:06 AM
Good one
Fatima DiarraPosted Apr 4, 2011, 9:38 AM
After deployment when clicked add it displays the following error: "There was no endpoint listening at http://localhost:51914/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
Srihari ChinnaPosted Jan 22, 2011, 9:05 AM
Sriram, Nice artical -Chinna