Hardcoding endpoint information into the host application is not ideal since endpoint details may change over time. It's not hard to imagine how you could store the endpoint information in a configuration file or database and read it while initializing ServiceHost. Since this is a common need, WCF automatically provides this functionality through the predefined configuration section.
The following configuration file defines the same two endpoints that were specified by calling AddServiceEndpoint:Configuring Transport Security
...