protected void CallA_Click(object sender, EventArgs e) { ServiceAClient client = null; try { client = new ServiceAClient(); LiteralWeb.Text = "A:" + client.GetSomething(); } finally { client.Close(); } }
public string PassSomethingToA() { ServiceAClient client = null; try { client = new ServiceAClient(); return(client.GetSomething()); } finally { client.Close(); } }
private void InitProxy() { //传递的参数是endpoint的名字 proxyA = new ServiceAClient("BasicHttpBinding_IServiceA"); proxyB = new ServiceBClient("BasicHttpBinding_IServiceB"); }
public HomeController(ILogger <HomeController> logger, ServiceAClient serviceAclient) { this.serviceAclient = serviceAclient; _logger = logger; }