I notice that if i send an array on webservice with array parameter, I encounter the unhandled errorexception but, when i send plain string, i could send the data on webservice with string parameter. I'd searched and follow the threads to pass the array but, it did not work. did i miss something?
client side:
LocalService.Service1Client a = new LocalService.Service1Client();
LocalService.PersonalDetail[] Entity = new LocalService.PersonalDetail[1];
LocalService.PersonalDetail Entity2 = null;
Entity2 = new LocalService.PersonalDetail();
Entity2.Firstname = "TEST";
Entity2.Lastname = "TEST";
Entity2.Middlename = "TEST";
Entity2.CreatedDate = DateTime.Today;
Entity[0] = Entity2;
a.Open();
Console.Write(a.GetLookOutList(Entity));
a.Close();
wcf server side.
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetLookOutList(PersonalDetail[] obj);
}
public class Service1 : IService1
{
public string GetLookOutList(PersonalDetail[] obj)
{
IResponse Lol = new LookOutList(obj);
return Lol.Response();
}
}
[DataContract(Name = "PersonalDetail")]
public class PersonalDetail
{
[DataMember(Name = "Firstname")]
public string Firstname
{ get; set; }
[DataMember(Name = "Middlename")]
public string Middlename
{ get; set; }
[DataMember(Name = "Lastname")]
public string Lastname
{ get; set; }
[DataMember(Name = "CreatedDate")]
public DateTime CreatedDate
{ get; set; }
}