http://stackoverflow.com/questions/18720810/wcf-service-base-address-vs-endpoint-address
baseAddress is just that, the base address for your endpoints (unless specified explicitly).
So every <endpoint> will inherit from <baseAddress> (which is why they are usually "" and "mex"). e.g.
<baseAddresses> <add baseAddress="http://127.0.0.1:1337/" /> </baseaddresses> ... <endpoint address="" contract="MyService.IMyContract" ... /> <endpoint address="mex" contract="IMetadataExchange" ... />
You now have two endpoints:
http://127.0.0.1:1337/ - service endpoint
http://127.0.0.1:1337/mex - metadata endpoint
By exempting the <baseAddress> you‘re requiring the <endpoints> to both be fully qualified (including the mex (which is not)). e.g.
exempt 免除;豁免 省略了baseAddress,然后就要求endpoint中的地址是完全限定的
<baseAddresses></baseaddresses> ... <endpoint address="net.tcp://127.0.0.1:1337/" contract="MyService.IMyContract" ... /> <endpoint address="http://127.0.0.1:1337/mex" contract="IMetadataExchange" ... />
You now have two different endpoints:
net.tcp://127.0.0.1:1337/ - service endpoint
http://127.0.0.1:1337/mex - metadata endpoint
时间: 2024-10-10 13:40:08