Пример #1
0
        public void SyncCall()
        {
            string serviceUrl = System.Configuration.ConfigurationManager.AppSettings["ServiceURL"];

            RemoteObject.MyObject app = (RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject), serviceUrl);
            Response.Write("[Sync]app.Add(18, 22) = " + app.Add(18, 22) + "<br/>");
        }
Пример #2
0
 static void Main(string[] args)
 {
     RemoteObject.MyObject app =
         (RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject), System.Configuration.ConfigurationSettings.AppSettings["ServiceURL"]);
     Console.WriteLine(app.Add(1, 2));
     Console.ReadLine();
 }
Пример #3
0
 public void AsyncCall()
 {
     //e = new ManualResetEvent(false);
     try
     {
         string serviceUrl                    = System.Configuration.ConfigurationManager.AppSettings["ServiceURL"];
         RemoteObject.MyObject app            = (RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject), serviceUrl);
         AsyncCallback         RemoteCallback = new AsyncCallback(this.OurRemoteAsyncCallBack);
         RemoteAsyncDelegate   RemoteDel      = new RemoteAsyncDelegate(app.TimeConsumingRemoteCall);
         IAsyncResult          RemAr          = RemoteDel.BeginInvoke(RemoteCallback, null);
         Response.Write("Async Function calling... ");
         RemAr.AsyncWaitHandle.WaitOne();
     }
     catch (Exception)
     {
     }
 }