1.服务端配置如下(一个Service节点下可有多个endpoint,):
1 12 2 3 3 16 15"Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="returnFaults"> 4 4 15 14"http://localhost:8000/GIX4" binding ="customBinding" 5 5 bindingConfiguration="compactBindingConfig" contract="Microsoft.ServiceModel.Samples.ICalculator"/> 6 6 "basic" binding="basicHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator"> 7 8 7"secure" binding="wsHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator"> 9 810 9 14 1311 10 13 12"http://localhost:8000/GIX4"/> 12 11
2. 客户端配置:
12 3 164 6"BasicHttpBinding_ICalculator" /> 5 7 12"CustomBinding_ICalculator"> 8 119 10 13 15"WSHttpBinding_ICalculator" /> 14 17 31"http://localhost:8000/GIX4" binding="customBinding" 18 bindingConfiguration="CustomBinding_ICalculator" contract="Calculator.Service.ICalculator" 19 name="CustomBinding_ICalculator" /> 20 "http://localhost:8000/GIX4/basic" binding="basicHttpBinding" 21 contract="Calculator.Service.ICalculator" 22 name="basic" /> 23 "http://localhost:8000/GIX4/secure" binding="wsHttpBinding" 24 contract="Calculator.Service.ICalculator" 25 name="secure"> 26 3027 29"chenlh@huawei" /> 28
3.客户端声明如下:
1 CalculatorClient client = new CalculatorClient("basic");