Exemplo n.º 1
0
        protected void CallBA_Click(object sender, EventArgs e)
        {
            ServiceBClient client = null;

            try
            {
                client          = new ServiceBClient();
                LiteralWeb.Text = "B -> A:" + client.PassSomethingToA();
            }
            finally
            {
                client.Close();
            }
        }
        public string PassSomethingToB()
        {
            ServiceBClient client = null;

            try
            {
                client = new ServiceBClient();
                return(client.GetSomething());
            }
            finally
            {
                client.Close();
            }
        }
Exemplo n.º 3
0
 private void InitProxy()
 {
     //传递的参数是endpoint的名字
     proxyA = new ServiceAClient("BasicHttpBinding_IServiceA");
     proxyB = new ServiceBClient("BasicHttpBinding_IServiceB");
 }
 public async Task<string> GetGreeting(string name)
 {
     ServiceBClient client = new ServiceBClient();
     return await client.GetGreetingAsync();
 }