0

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

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

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

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

4

1 回答 1

2

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/

于 2013-07-07T17:43:37.930 回答