android soap对象序列化,如何序列化匿名对象以通过SOAP Web服务发送?

[WebMethod(EnableSession = true)]

public PatientsResult GetPatientList(bool returnInactivePatients) {

if (!IsLoggedIn()) {

return new PatientsResult() {

Success = false,

LoggedIn = false,

Message = "Not logged in"

};

}

Func, IEnumerable> filterActive =

patientList => returnInactivePatients ? patientList : patientList.Where(p => p.Status == "Active");

User u = (User)Session["user"];

return new PatientsResult() {

Success = true,

LoggedIn = true,

Message = "",

Patients = filterActive((from p in u.Practice.Patients

select new PatientResult() {

PhysicianID = p.PhysicianID,

Status = p.Active ? "Active" : "Inactive",

PatientIdentifier = p.PatientIdentifier,

PatientID = p.PatientID,

LastVisit = p.Visits.Count > 0 ? p.Visits.Max(v => v.VisitDate).ToShortDateString() : "",

Physician = (p.Physician == null ? "" : p.Physician.FirstName + " " + p.Physician == null ? "" : p.Physician.LastName).Trim(),

})).ToList()

};

}

public class Result {

public bool Success { get; set; }

public bool LoggedIn { get; set; }

public string Message { get; set; }

}

public class PatientsResult : Result {

public List Patients { get; set; }

}

public class PatientResult {

public int PatientID { get; set; }

public string Status { get; set; }

public string PatientIdentifier { get; set; }

public string Physician { get; set; }

public int? PhysicianID {get;set;}

public string LastVisit { get; set; }

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值