开发者

WCF, IIS, and Endpoints

开发者 https://www.devze.com 2023-01-29 08:21 出处:网络
Learning WCF (I know, late to the party) I am working through Juval Lowy\'s Programming WCF book.I see that I can configure multiple endpoints (including URI\'s) for my service.

Learning WCF (I know, late to the party)

I am working through Juval Lowy's Programming WCF book. I see that I can configure multiple endpoints (including URI's) for my service.

However, when I host these in IIS, only the location of the .svc file seems to matter. Is the multiple endpoints/addresses thing only applicable i开发者_如何学Gof you are self-hosting? Am I missing something about hosting services in IIS?


"only the location of the .svc ", you're heading to this because baseaddress are provided by IIS in case of web-hosting (IIS hosting) unless you're using CustomServiceHostFactory. Then whatever value you provide in address, are appended to baseaddress (.svc/..)


You needs to give several host name in IIS for the the same WCF and set several endpoints in the client section of web.config as:

    <client>
      <endpoint address="hostname1/myservice.svc" ... />
      <endpoint address="hostname2/myservice.svc" ... />
      <endpoint address="hostname3/myservice.svc" ... />
    </client>

Then you can consume them as: hostname1/myservice.svc hostname2/myservice.svc hostname3/myservice.svc

0

精彩评论

暂无评论...
验证码 换一张
取 消