/// <summary> /// wcf request /// </summary> public static void wcftest() { //var binding = new BasicHttpBinding(); //binding.TransactionFlow = true; //binding.Security.Mode = SecurityMode.None; //"wsHttpBinding_IServiceTest" //var pointAddress=new EndpointAddress("http://localhost/ProductService/ProductService.svc"); //var serviceSvc = ChannelFactory<IServiceTest>.CreateChannel(binding,pointAddress); //var factory = new ChannelFactory<IServiceTest>("basicHttpBinding_IServiceTest"); //IServiceTest svcClient = factory.CreateChannel(); var svcClient = WcfUtility.WCFInvoke <IServiceTest>("basicHttpBinding_IServiceTest"); var product = svcClient.GetProductById(1); var result = svcClient.AddProduct(new ServiceModel.Product { Id = 5, Cost = 50, Name = "50202020" }); }