8.6. Choosing Implementations at Runtime

Instead of hard-coding the service URL in client code, you can add it to the application's XML configuration file. For Web applications, this is the web.config file that's in the application's vroot or the folder where your Web form is located. For all other application types, it's a file with the same name as the main application's executable, but with a .config extension. For example, if your Windows application is called myapp.exe, the configuration file is called mayapp.exe.config and resides in the same folder as myapp.exe. The application's configuration file has an <appSettings> section where you can add your own configuration information. For example, if you know the Web service's URL, you can ...

Get Real World XML Web Services: For VB and VB .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.