0
您是否需要在iOS中使用WCF服務上的POST方法創建相同的對象?在WCF服務的POST調用的使用iOS 5如何使用Json將對象發佈到WCF服務
例
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "")]
//method
Employee PostEmp(Employee emp);
[DataContract]
public class Employee
{
[DataMember]
public string firstname { get; set; }
[DataMember]
public string idkey { get; set; }
[DataMember]
public string lastname { get; set; }
[DataMember]
public string salary { get; set; }
public Employee(string first, string id, string sal, string last)
{
firstname = first;
idkey = id;
salary = sal;
lastname = last;
}