how to specify endpoint address for WCF service hosted on IIS?

.net, c#, wcf

Solution

Assuming the base address of your service is `http://localhost:1111/PublicService.svc`, specifying the `address="/myAddress"` attribute would cause that endpoint’s address to become `http://localhost:1111/PublicService.svc/myAddress`. The endpoint’s relative path comes after the service address.

Problem

I have simple wcf service with basicHttpBindings and want to host it on IIS. but when I'm specifying `<endpoint address="/myAddress" binding="basicHttpBinding" contract="Wcf.Contracts.IPublicService"/>` myAddress is ignored. In other words I'm expecting it creates my service endpoint sth like this localhost:1111/myaddress/PublicService.svc, but it creates endpoint simply by combining localhost and PublicService.svc - localhost:1111/publicservice.svc. why I need? I have some other services hosted in project and want to create each of them with different url after localhost.(I don't want to move them to different folder). I've googled and discovered that host base address is ignored when hosting on IIS, is this true for endpoint addresse too? thanks in advance ``` <service name="Wcf.Services.AdminService"> <endpoint address="/address" binding ="basicHttpBinding" contract="Wcf.Contracts.IAdminService"/> <endpoint address="mex" binding ="mexHttpBinding" contract="IMetadataExchange"/> </service> <service name="Wcf.Services.PublicService"> <endpoint address="/address1" binding="basicHttpBinding" contract="Wcf.Contracts.IPublicService"/> <endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange"/> </service> ```

Original source