Jader Dias
Jader Dias

Reputation: 90583

Can I expose multiple webHttpBinding endpoints in the same port?

  1. I know I can expose multiple netTcpBinding endpoints in the same port.
  2. I know I can't expose an endpoint in the same port used by IIS.
  3. What about multiple webHttpBinding endpoints in the same port?

Upvotes: 2

Views: 1193

Answers (1)

Neil
Neil

Reputation: 1922

every Address, Binding, Contract combination in WCF must be unique, In other words you can have multiple Contracts (ITransactService,IQueryService) on the same binding (webHttp or Http) with the same address (http://localhost:8080/MyService)

 <endpoint name="MyServiceTrans" binding="customBinding"
              bindingConfiguration="secureBinaryHttpBinding"
              contract="MyService.SL.ITransactService"
              behaviorConfiguration="MyCustomEndpointBehavior"/>

    <endpoint name="MyServiceQuery" binding="customBinding"
              bindingConfiguration="secureBinaryHttpBinding"
              contract="MyService.SL.IQueryService"
              behaviorConfiguration="MyCustomEndpointBehavior"/>

    <endpoint name="MyServiceAdmin" binding="customBinding"
              bindingConfiguration="secureBinaryHttpBinding"
              contract="MyService.SL.IAdminService"
              behaviorConfiguration="MyCustomEndpointBehavior"/>

Three custom endpoints above, with the same binding, and the same address, different Contracts

Upvotes: 2

Related Questions