static void Main(string[] args) { CallBackClient callBackobj = new CallBackClient(); InstanceContext cntxt = new InstanceContext(callBackobj); CafeShopServiceClient clientproxy = new CafeShopServiceClient(cntxt); Random rd = new Random(5000); clientproxy.RegistermyCofeeShop("Cafe Centre " + rd.Next().ToString()); for (int iCofee = 0; iCofee < 100; iCofee++) { clientproxy.SellCofee(1); } Console.ReadLine(); }
static void Main(string[] args) { CallBackClient callBackobj = new CallBackClient(); InstanceContext cntxt = new InstanceContext(callBackobj); CafeShopServiceClient clientproxy = new CafeShopServiceClient(cntxt); Random rd = new Random(5000); StoreLocation slCurrentUser = StoreLocation.CurrentUser; StoreName snMy = StoreName.My; X509FindType x509 = X509FindType.FindBySubjectDistinguishedName; clientproxy.ClientCredentials.ClientCertificate.SetCertificate(slCurrentUser, snMy, x509, "CN=CafeClient"); clientproxy.RegistermyCofeeShop("Cafe Centre " + rd.Next().ToString()); for (int iCofee = 0; iCofee < 100; iCofee++) { clientproxy.SellCofee(1); } Console.ReadLine(); }