且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过Android应用程序调用asp.net web方法

更新时间:2022-11-06 13:45:17

转而使用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