JMarsch
JMarsch

Reputation: 21751

WCF, IIS, and Endpoints

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 if you are self-hosting? Am I missing something about hosting services in IIS?

Upvotes: 2

Views: 287

Answers (2)

amit
amit

Reputation: 2123

"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/..)

Upvotes: 2

airbai
airbai

Reputation: 3966

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

Upvotes: 0

Related Questions