简体   繁体   English

从Xamarin调用ac#Web表单Web服务

[英]Calling a c# web form web service from Xamarin

I created ac# aspx.cs web form web service in visual studio which would return a string of Json result upon calling this: 我在Visual Studio中创建了ac#aspx.cs Web表单Web服务,该服务将在调用此命令时返回Json结果字符串:

string url = "http://crowd.sit.nyp.edu.sg/FRSIPad/GetFacilities.aspx?DepartmentID=" + departmentID
            + "&Block=" + block + "&Level=" + level + "&Name=" + name + "&DeviceID=&Hash=";

The web service is written in Json RESTful method. Web服务使用Json RESTful方法编写。 I hosted the program on the IIS server. 我将程序托管在IIS服务器上。 I read about calling the web service from Xamarin studio. 我读过有关从Xamarin Studio调用Web服务的信息。 I am doing this on the cross-platform and running on IOS. 我正在跨平台上并在IOS上运行。 I have researched about HttpWebRequest and i am not sure if i am on the right track. 我已经对HttpWebRequest进行了研究,但不确定自己是否走对了。 Please advice how i can call this web service of mine and store it into ac# object in xamarin? 请建议我如何调用我的此Web服务并将其存储到xamarin中的ac#对象中? Help would be much appreciated. 帮助将不胜感激。

I've been using RestSharp successfully in a Xamarin project. 我一直在Xamarin项目中成功使用RestSharp。 It works great. 效果很好。

Check it out: http://restsharp.org/ 检查一下: http : //restsharp.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM