Search code examples
wcfwcf-client

How to define endpoints(server and client) in WCF service


On adding a service reference to my class file, another config file called app.config is added to the class. Where should the endpoints be defined? Should they be in solution's config file or the new config file created in class?


Solution

  • The endpoints defined in server(web.config) is to expose the web service to others.
    The endpoints defined in Client(app.config) is to specify which service should the app connect to.
    So you must define the endpoint in both client and Server
    PS the binding configuration should be identity in both web.config and app.config.