C# 如何在xamarin Android应用程序中调用WCF服务

C# 如何在xamarin Android应用程序中调用WCF服务,c#,android,web-services,C#,Android,Web Services,对于同一个问题,我几乎看不到解决办法,但这对我来说是无能为力的。由于我第一次在我的应用程序中使用WCFWeb服务,我使用了以下代码来使用它,但我并没有得到结果,或者在异常情况下它会推送我 protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource

对于同一个问题,我几乎看不到解决办法,但这对我来说是无能为力的。由于我第一次在我的应用程序中使用WCFWeb服务,我使用了以下代码来使用它,但我并没有得到结果,或者在异常情况下它会推送我

  protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.login);
            button.Click += delegate {
                // button.Text = string.Format("{0} clicks!", count++);

                try
                {
                    localhost.Service1 myServ = new localhost.Service1();
                    myServ.Url = "http://192.168.1.103:49500/Service1.svc";
                    // Button button = FindViewById<Button>(Resource.Id.login);
                    button.Text = myServ.getMyWS();

                }
                catch (Exception ex)
                {
                    button.Text = ex.Message;
                }
            };
}
这是我的示例web服务,用于根据web服务的结果更改按钮的文本,目的是从服务器学习web服务调用。
需要进行哪些更改才能使其正常工作?

您的代码也不适用于我您的代码也不适用于我
 public string getMyWS()
        {
            return string.Format("Hello Dipak");
        }