Click here to Skip to main content
15,890,995 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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)
C#
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

C#
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

ASP.NET
<%@ 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.
Posted
Comments
_Asif_ 25-Jan-16 8:49am    
what do you mean exactly when you say "but I don`t know which file i have to send and how can i send this code to the android."
Member 12097108 25-Jan-16 8:58am    
Means I have created web service but now android developer want to use that web service in app. so i don`t know how can i send this web service to android developer.
i can i send url of this web service. I don`t know what i do next.
G3Coder 25-Jan-16 9:44am    
He will need a WSDL to consume - have a look at: https://drclawx.wordpress.com/2011/06/24/77/
Sinisa Hajnal 26-Jan-16 4:44am    
You don't send a file from the service, you send definition of the service (WSDL) and let him create proxy object from that. Or you create web api (REST service) and let him access it directly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900