【问题标题】:Support multiple urls for same WCF service (as web url rewrite)支持同一 WCF 服务的多个 url(作为 web url 重写)
【发布时间】:2013-07-04 02:01:20
【问题描述】:

我有一个由 IIS 托管的 WCF 服务。 它作为服务端点记录给程序员; https://api.company.com/services/soap1

但客户端必须定义端点 https://api.company.com/services/soap1/

问题;我怎样才能在没有痛苦的情况下支持他们?有没有办法像为 wcf 服务请求重写 url 自动添加最后一条线索?

注意:服务使用 mtom 编码 SOAP 消息。

【问题讨论】:

  • 只需配置多个端点。谷歌关于同一 WCF 服务的多个配置

标签: wcf c#-4.0 wcf-binding


【解决方案1】:

WCF 允许您为同一服务配置多个端点。

<services>
 <servicename ="MultipleEndpoints.Service1" behaviorConfiguration ="Mg">
    <endpointname="firstBinding"
      address ="https://api.company.com/services/soap1"
      binding ="basicHttpBinding"
      contract ="MultipleEndpoints.IService1" />
     <endpointname="secondBinding"
       address ="https://api.company.com/services/soap1/"
       binding ="basicHttpBinding"
      contract ="MultipleEndpoints.IService1"/>
    <endpointcontract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
 </service>
 </services>

示例见:http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/configuring-multiple-end-points-for-wcf-service/

【讨论】:

    猜你喜欢
    • 2015-04-13
    • 2011-12-31
    • 2012-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-19
    • 1970-01-01
    相关资源
    最近更新 更多