Hello Every One,
we have Two Developer.I am .net developer and one is Android developer.
now our task is.I have to create web services in c# and send it to that web services to the android developer.I have created simple practice web services in c#.but I don`t know which file i have to send and how can i send this code to the android.
I will sen my web services code.
Employee.cs(class file)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public class Employee
{
public int Id{get;set;}
public string Name{get;set;}
public int Salary { get; set; }
}
MyServicesClass.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using System.Web.Script.Serialization;
[WebService]
public class MyServicesClass
{
[WebMethod]
public Employee[] GetEmployeessXML()
{
Employee[] emps = new Employee[]
{
new Employee
{
Id=101,
Name="Manish",
Salary=5000
},
new Employee
{
Id=102,
Name="Ronak",
Salary=8000
}
};
return emps;
}
[WebMethod]
[ScriptMethod(ResponseFormat=ResponseFormat.Json)]
public string GetEmployeessJSON()
{
Employee[] emps = new Employee[]
{
new Employee
{
Id=101,
Name="Manish",
Salary=5000
},
new Employee
{
Id=102,
Name="Ronak",
Salary=8000
}
};
return new JavaScriptSerializer().Serialize(emps);
}
public MyServicesClass()
{
}
}
MyServices.asmx
<%@ WebService Language="C#" CodeBehind="~/App_Code/MyServices.cs" Class="MyServicesClass" %>
This is my web services. Now I don`t know how can i send this web service to android developer.
Please can yo help me for this.