Monday, December 29, 2008

Dynamic Web Reference for ASP.Net Class Projects

Usually web service references are added on the main web application but what if you want to isolate it since you'll only be using it on your business layer (class project); the answer, of course, is to add it on your class project. Great, but what if the web service is suddenly relocated to another server? Wouldn't it be nice if you'll have a way to just change the url and point it to the new web service url? To accomplish that, simply follow the following instructions:

1. Set your Class Project Web Reference' URL Behavior property to 'Dynamic'.
2. Open the app.config. The first step will generate an appsettings entry for your web service. Copy the generated appsettings entry.
3. Go to your web application web.config and paste it inside the appSettings and your done.

Share/Save/Bookmark

No comments:

Post a Comment