c# - 使用 Xamarin.Forms 使用 soap web 服务

标签 c# xamarin xamarin.forms xamarin-studio

我在 Windows 上使用 Xamarin Studio 制作一个 Android 应用程序(可移植 Xamarin.Forms 项目)。我正在尝试使用此页面上的指南使用 Web 服务:http://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/在“使用 SOAP 服务”部分。

但是,我似乎根本无法让它工作。我可以成功生成代理(使用此公共(public)网址:http://wsf.cdyne.com/WeatherWS/Weather.asmx 用于测试目的)。生成一个名为“Reference.cs”的新文件。

但是文件 Reference.cs 产生了几个编译错误:

错误 CS0234:命名空间“System.Runtime.Serialization”中不存在类型或命名空间名称“IExtensibleDataObject”(是否缺少程序集引用?)(CS0234) (XamarinFormsTutorial)

..和其他 41 人(均为 CS0234)

有人知道发生了什么事吗?

最佳答案

我最近不得不实现一个使用 webservice asmx 的跨平台应用程序。

我的解决方案是在两个项目(Android 和 IOS)中使用 Web 服务。 在我使用的共享项目中:

#if __ANDROID__
using "namespace droid webservice";
#endif

#if __IOS__
using "namespace ios webservice";
#endif

在代码中创建一个新的网络服务实例就足够了。

关于c# - 使用 Xamarin.Forms 使用 soap web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28353948/

相关文章:

c# - 适用于 Android(又名 Xamarin.Android)的 OxyPlot Mono 错位绘制。 (堆积柱系列)

c# - android设备上的套接字连接拒绝错误

xamarin.forms - 更新到 Xamarin Forms 5 后,Xamarin 形成 Android 项目 TargetFrameworkVersion 错误

c# - 将 comboBox 设置为自定义显示格式

c# - 使用 Azure SAS URL 将 Blob(所有文件)从 Azure Blob 存储下载到浏览器中

c# - Xamarin。恢复后的不同行为应用程序

c# - 如何让 Label 显示带有不同颜色字母的 FormattedString?

c# - Linq 选择在内存中执行的不同计数

javascript - 为什么 WebForms 不断呈现这个 data- 属性?

c# - 在运行时更改 xamarin.forms 颜色