2016-05-23 133 views

回答

1

,如果你的服务是不是一个WCF服务,您必须导入Web引用作为.NET 2.0的Web服务:

Step 1

step 2

调用服务:

 Button button = FindViewById<Button> (Resource.Id.myButton); 

     button.Click += delegate { 
      SoapApp.www.webservicex.net.GlobalWeather soapservice = new SoapApp.www.webservicex.net.GlobalWeather(); 
      var cities = soapservice.GetCitiesByCountry("peru"); 
      button.Text = cities; 
     }; 

这就是结果:

Result

如果它不工作,尝试这样做,建立在Visual Studio中的代理在一个新的项目,并将它们复制类的Xamarin Studio项目,我知道这不是最好的方法,但是是一种解决方法。

不要忘记添加System.Web.ServicesSystem.ServiceModel参考。

对不起,Xamarin工作室西班牙文版,希望它可以帮助你