Code
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ICalculator">
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
address="http://localhost:8000/ServiceModelSamples/Service/CalculatorService"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICalculator"
contract="Microsoft.ServiceModel.Samples.ICalculator"
name="WSHttpBinding_ICalculator">
</endpoint>
</client>
</system.serviceModel>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ICalculator">
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
address="http://localhost:8000/ServiceModelSamples/Service/CalculatorService"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICalculator"
contract="Microsoft.ServiceModel.Samples.ICalculator"
name="WSHttpBinding_ICalculator">
</endpoint>
</client>
</system.serviceModel>
</configuration>
多base address 的配置文件
<
service
behaviorConfiguration
="MyServiceBehavior"
name
="Hello"
>
< endpoint
address ="httpHello"
binding ="basicHttpBinding"
contract ="IHello" />
< endpoint
address ="nettcpHello"
binding ="netTcpBinding"
contract ="IHello" />
< endpoint address ="MEX" binding ="mexHttpBinding" contract ="IMetadataExchange" />
< host >
< baseAddresses >
< add baseAddress ="http://localhost:8080/" />
< add baseAddress ="net.tcp://localhost:8090/" />
</ baseAddresses >
</ host >
</ service >
< endpoint
address ="httpHello"
binding ="basicHttpBinding"
contract ="IHello" />
< endpoint
address ="nettcpHello"
binding ="netTcpBinding"
contract ="IHello" />
< endpoint address ="MEX" binding ="mexHttpBinding" contract ="IMetadataExchange" />
< host >
< baseAddresses >
< add baseAddress ="http://localhost:8080/" />
< add baseAddress ="net.tcp://localhost:8090/" />
</ baseAddresses >
</ host >
</ service >