zoukankan      html  css  js  c++  java
  • WCF Host中的BaseAddress 和 Endpoint中的Address的区别

    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

  • 相关阅读:
    Gson简要使用笔记
    android入门到熟练(五)---广播
    95&&96.Unique Binary Search Trees I&&II
    day 08 文件操作
    07 深浅拷贝
    06 day小数据池
    05,.字典,集合
    列表和元组
    字符串
    while 循环,格式化输出和运算编码
  • 原文地址:https://www.cnblogs.com/chucklu/p/4652259.html
Copyright © 2011-2022 走看看