none
how to get data from remote wcf service RRS feed

  • Question

  • hi ;

    I want to get data from remote wcf ;

    we are using wcf in work office and I want to access and get data from my home ;

    I configured everything and able to connect wcf and access method But not get data;

    Wcf Side like below

     public Datatable GetGlobalInfo()
      {
    var con=new SqlConnection("server=x;datasource=xx;user id=xxx;pwd=xxxx");
    con.Open();
    var adap=new SqlDataAdapter("SELECT TOP 1 FIELD FROM TABLE",con)
    vat dt=new Datatable();
    adap.Fill(dt);
    con.Close();
    return dt;
    }

    client side

     using (var srv = new webapi())
          {
            
           srv.url = "http://api.adres.com/webapi.svc/apiservice";
            var dt = srv.getglobalinfo();
            messagebox.show(dt.Rows[0][0].ToString());
          }
      
      return like error 
      
    The underlying connection was closed: An unexpected error occurred on a receive.


    • Edited by Aly14 Sunday, December 8, 2019 4:18 PM aa
    Sunday, December 8, 2019 3:34 PM

All replies