I was having problems sending an object that has 3 properties, the problem is with the array of customers while sending I have the following error object:
You can not serialize member. Because it is an interface.
if the property off customers ws works very well. I have tried in various ways to eliminate the error but none seems to work left a fragment of code so that they can give me their point of view. thank you very much
public class CustomersResponse
{
public bool Success { get; set; }
public string Error { get; set; }
public customer[] ListCustomers { get; set; }
}
and the code of ws is
/// <summary>
///
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class wsCustomers : System.Web.Services.WebService
{
[WebMethod]
public CustomersResponse CustomersResult()
{
CustomersResponse customers = new CustomersResponse ();
try
{
using (var context = new DataContext())
{
customers.Success = true;
customers .Error = string.Empty;
}
}
catch (Exception ex)
{
customers .Success = false;
customers .Error = ex.Message.ToString();
}
return customers ;
}
}
if I delete the property ListCustomers the ws works well, if I put marks the mistake :(