In my client project(asp.net MVC4) I have a class file
public class Person
{
public string Name { get; set; }
public int Phone { get; set; }
}
And from the controller I try to call my web service method. The web service part is different project.
Person per = new Person();
per.Name = "Vibin";
per.Phone = 123456789;
FirstService.WebService service = new FirstService.WebService();
service.TakeList(per);
And my web service method is
[WebMethod]
public void TakeList(Person theList)
{
// stuff
}
The problem is I am unable to pass the value to the web method. I searched a lot to find a solution but failed. Please help me to fix this issue. Also please provide an example for sending array values to web service in asp.net c#. Thanks in advance.