What is the purpose of base address in WCF service? How it is specified?

 Posted by Prasham on 10/11/2010 | Category: WCF Interview questions | Views: 14814 | Points: 40
Answer:

When multiple endpoints are associated with WCF service, base address (one primary address) is assigned to the service, and relative addresses are assigned to each endpoint. Base address is specified in <host> element for each service.
E.g.
<configuration>

<system.servicemodel>
<Services>
<service name=”MyService>
<host>
<baseAddresses>
<add baseAddress =”http://localhost:6070/MyService”>
</baseAddresses>
</host>
</service>
<services>
</system.servicemodel>
</configuration>


Thanks
Prasham


| Alert Moderator 

Comments or Responses

Login to post response