I am using VS 2005 (C# ). My Webservice returns a type as follow :
[WebMethod]
public Employee getEmployee( )
{
Employee emp=new Employee();
emp.EmpID=1000;
emp.EmpName="Wallace";
return emp;
}
from Client side i have created a Proxy.
localhost.Service1 svc = new WindowsApplication1.localhost.Service1();
How can i get the Employee object returned by getEmployee() method.
Do i need to create a Employee class in client side ?
.... like ...
localhost.Service1 svc = new WindowsApplication1.localhost.Service1();
Employee emp = new Employee();
object obj= svc.getEmployee();
emp = (Employee)obj;
MessageBox.Show("Id=:" + emp.EmpID.ToString() + "," + "Name:=" + emp.EmpName);
By doing so also i am receiving casting error.