.net - WCF Windows Service Host - WCF Http Request Mapping -


i hosting wcf rest service within windows service hosting container , having issue mapping http requests distinct dns name given wcf endpoint. seems requests mapped via ip address , dns name being ignored. have been researching if possible add "host header" given http wcf endpoint when hosted windows service. know mechanism iis employs distinctly map multiple web site dns names distinct websites using single ip address. same mapping mechanism or similar available wcf http endpoint hosted windows service?

for example if have 2 endpoints configured on same port:

<system.servicemodel>     <services>         <service name="requestinstanceservice">             <endpoint address="http://dns1.mydomain.com/requestinstanceservice" binding="webhttpbinding"   contract="myservice.irequestinstanceservice" >             </endpoint>         </service>         <service name="centralkeyingauthorityservice">             <endpoint address="http://dns2.mydomain.com/ckaservice" binding="webhttpbinding"  contract="myservice.icentralkeyingauthorityservice" >             </endpoint>         </service>               </services>     <behaviors>         <endpointbehaviors>             <behavior>                 <webhttp />             </behavior>         </endpointbehaviors>     </behaviors>     <bindings /> </system.servicemodel> 

i able distinctly map requests dns1.mydomain.com requestinstanceservice , requests dns2.mydomain.com ckaservice. if hosted in iis, assumption able set host header dns1.mydomain.com , dns2.mydomain.com direct request appropriate website (wcf host).

since hosting these wcf services within windows service host behavior seems bit different. appears dns component irrelevant since can reach requestinstanceservice endpoint using either dns name:

http://dns1.mydomain.com/requestinstanceservice or http://dns2.mydomain.com/requestinstanceservice

can me understand how make mapping distinct dns name taken account in mapping?


Comments