如何使用可重用的单一共享代码库调用跨平台的Web服务

时间:2022-05-17 02:27:37

Now I am going on with the web service call for cross platform with the visual studio of xamarin.forms have build a sample hello world program with the portable lib.

现在我继续使用xamarin的visual studio来进行跨平台的Web服务调用。使用可移植的lib构建了一个示例hello world程序。

Now I need to build it for web service should use a reusable single code share between various platform.

现在我需要为Web服务构建它应该在各种平台之间使用可重用的单个代码共享。

Tried with the below:

尝试以下:

https://forums.xamarin.com/discussion/19303/how-to-consume-wcf-service-in-xamarin-forms-pcl

http://www.hanselman.com/blog/XamarinFormsWriteOnceRunEverywhereANDBeNative.aspx

http://www.c-sharpcorner.com/UploadFile/890595/introduction-to-xamarin-android-with-mvvmcross/

I face lot of issues.

我面临很多问题。

1 个解决方案

#1


Since you are using a RESTful web service, you should be able to do everything you need with an HttpClient. Try this thread:

由于您使用的是RESTful Web服务,因此您应该可以使用HttpClient完成所需的一切。试试这个帖子:

http://forums.xamarin.com/discussion/11846/httpclient-in-ios-android-and-wp8-with-a-portable-class-library

#1


Since you are using a RESTful web service, you should be able to do everything you need with an HttpClient. Try this thread:

由于您使用的是RESTful Web服务,因此您应该可以使用HttpClient完成所需的一切。试试这个帖子:

http://forums.xamarin.com/discussion/11846/httpclient-in-ios-android-and-wp8-with-a-portable-class-library