WCF配置元素:baseAddressPrefixFilters [英] WCF Config element: baseAddressPrefixFilters

查看:66
本文介绍了WCF配置元素:baseAddressPrefixFilters的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了有关此元素的文档,但是仍然无法理解其目的。以下是示例中如何使用它的示例:

I have read the documentation for this element but still fail to understand what its purpose is. Here is a sample of how I've seen it used in examples:

<serviceHostingEnvironment>
  <baseAddressPrefixFilters>
    <add prefix="http://localhost:5100/"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

我想了解服务节点中的基址不执行的操作。我不明白此元素的实际用途。

I want to understand what this does that the base addresses in a service node doesn't do. I don't understand what this element is actually used for.

推荐答案

WCF服务主机每次仅允许一个基地址方案(在这种情况下为HTTP)。现在,如果您在配置了多个基本地址的IIS上部署WCF服务,例如 http://www.example.com http://example.com ,您将看到一个错误。使用baseAddressPrefixFilters可以过滤两个基本地址之一,您的服务将正常运行。

A WCF service host will only allow a single base address per scheme (HTTP in this case). Now if you deploy a WCF service on an IIS configured with multiple base addresses, for example http://www.example.com and http://example.com you will see an error. Using the baseAddressPrefixFilters you can filter one of the two base addresses and your service will run just fine.

这篇关于WCF配置元素:baseAddressPrefixFilters的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆