通过添加服务引用后生成的代码,可以得知首先要设置Basic连接写法的属性,并且设置WCF服务的地址: 我在这里建立工厂类如下: using System; using System.ServiceModel; using System.ServiceModel.Channels; using ShoppingMall.Enums; namespace ShoppingMall.ClientBll { public class EndpointFactory { private static Bi…