【问题标题】:How to consume wcf service in xamarin.forms?如何在 xamarin.forms 中使用 wcf 服务?
【发布时间】:2017-10-28 11:06:45
【问题描述】:

我是 xamrin 表单的新手,现在我想访问 xamarin 中的 wcf 服务 froms`WebRequest request = WebRequest.Create(uri); request.Method = "POST"; request.ContentType = "text/plain; charset=utf-8";

            string json = JsonConvert.SerializeObject(ObjInput);                

            using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
            {
                writer.Write(json);
            }

            HttpWebResponse responce = (HttpWebResponse)request.GetResponse();
            Stream reader = responce.GetResponseStream();

            StreamReader sReader = new StreamReader(reader);
            string outResult = sReader.ReadToEnd();              

            return outResult;` am using this code but getting error in Getresponse stream. 

提前谢谢..

【问题讨论】:

    标签: wcf xamarin.forms


    【解决方案1】:

    官方xamarin演练:Walkthrough - Working with WCF

    使用 WFC 的官方 xamarin 演练:Consuming a Windows Communication Foundation (WCF) Web Service

    来自演练的官方 xamarin 示例:WCF Walkthrough Sample

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-31
      • 1970-01-01
      • 2017-08-06
      • 1970-01-01
      • 2017-08-08
      • 2015-05-03
      • 1970-01-01
      • 2015-07-22
      相关资源
      最近更新 更多