0

我的应用程序有一个 app.config 文件,它定义了一系列与此类似的 Web 服务:

<client>
      <endpoint address="https://xxxxxx.local:12610/Applicationws.svc"
          binding="basicHttpBinding" bindingConfiguration="test1"
          contract="Applicationws.Applicationws" name="test1" />

        <endpoint address="https://yyyyyy.local:12610/Applicationws.svc"
            binding="basicHttpBinding" bindingConfiguration="test2"
            contract="Applicationws.Applicationws" name="test2" />

        <endpoint address="https://zzzzzz.local:12610/Applicationws.svc"
            binding="basicHttpBinding" bindingConfiguration="test3"
            contract="Applicationws.Applicationws" name="test3" />
</client>

我希望能够为每个端点条目添加一些额外的属性,以便我可以轻松识别它。这些将是诸如描述、类型等项目,然后能够在 ChannelEndpointElement 对象或类似对象中获取它,例如

<endpoint address="https://zzzzzz.local:12610/Applicationws.svc"
    binding="basicHttpBinding" bindingConfiguration="test3"
    ontract="Applicationws.Applicationws" name="test3"
    description="some web service" type="myappname" />

我已经在网上嗅到了并尝试阅读文档,但我找不到任何接近的东西。想要做的事情真的这么不合理吗?我最后的想法是使用某种分隔符将额外的属性附加到名称值。

4

0 回答 0