[OperationContract]
[WebInvoke(UriTemplate = "/CreatePerson", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, Method = "POST")]
EMPDetails CreatePerson(EMPDetails createPerson);
// Implementation
public EMPDetails CreatePerson(EMPDetails createPerson)
{
EMPDetails detail = new EMPDetails();
detail.Eid = 111;
detail.Name = "Gopi";
return detail;
}
///data contract
[DataContract]
public class EMPDetails
{
[DataMember]
public int Eid { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string photo { get; set; }
[DataMember]
public DateTime Dob { get; set; }
}
http://localhost:11113/employeeservice/CreatePerson"
如何在Android中将EMPDetails对象传递给服务。 我见过几个链接。大多数只提供一个参数。