如何通过Android应用程序调用asp.net web方法 [英] How to call a asp.net web method by android app
本文介绍了如何通过Android应用程序调用asp.net web方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在我的anroid应用程序中调用asp.net页面的web方法。
[WebMethod()]
public static string GetHomePageCoupon()
{
setConnectionString();
列表< 优惠券 > coupons = DataAccesLayer.GetHomePageCoupon();
返回Utility.Serialize < 列表<优惠券 > 跨度>>(优惠券);
}
实用程序.Serialize将返回JSON数据。
解决方案
转而使用WCF RESTful Web服务。
见 tutorial。 [ ^ ]
-KR
How can i call a webmethod of asp.net page in my anroid app.
[WebMethod()]
public static string GetHomePageCoupon()
{
setConnectionString();
List<Coupon> coupons = DataAccesLayer.GetHomePageCoupon();
return Utility.Serialize<List<Coupon>>(coupons);
}
Utility .Serialize will return JSON data.
解决方案
Rather go for WCF RESTful Web Service.
See this tutorial.[^]
-KR
这篇关于如何通过Android应用程序调用asp.net web方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文