The Web Settings Tool


Because manually changing proxy classes every time you add a new reference or update a reference can become very (very!) tedious, you can use an unsupported tool from Microsoft called the Web Settings Tool instead. (You can download it from http://www.microsoft.com/downloads/details.aspx?FamilyID=e1924d29-e82d-4d9a-a945-3f074ce63c8b.) This tool, an add-in to Visual Studio .NET, automates a lot of the mundane tasks that you need to perform when using WSE.

When generating proxies, the Web Settings Tool automatically creates a proxy that inherits from WebServicesClientProtocol—but only if the Microsoft.Web.Services DLL has been added as a reference to the project. However, it doesn’t do it in the same way as we did above when we changed the base class for the existing proxies.

Rather than modifying the proxy that’s generated by Visual Studio .NET, the Web Settings Tool adds a second proxy to the same class file. This new proxy inherits from WebServicesClientProtocol and is distinguished from the standard proxy class by the appending of Wse to the name of the proxy. If you look at the Object Browser, as shown in Figure 13-4, you’ll see that we now have two proxies—one for the normal Web service and one for the Web service that’s using WSE.


Figure 13-4: The Web Settings Tool generates the DiagnosticsWSWse class.

This method of creating the proxies might seem a little strange, but it actually makes more sense than simply changing every proxy you’re using. By creating two proxies, you have the option of using the standard Web service infrastructure or the WSE- enabled infrastructure without any need to change configuration options. If you include references to standard Web services and WSE-enabled Web services in the same project, you can use whichever version of the proxy is correct. You don’t have to worry about the tools creating the wrong type of proxy—both have been created, and you can simply use the one that’s required.

The Web Settings Tool also allows you to graphically configure most of the configuration options for the filters and to automatically update the necessary configuration files. We could use the Web Settings Tool to manage the configuration of WSE, but we’ll use it only to generate the correct proxies. To show you what’s actually occurring with the configuration, we’ll manually modify the configuration files as required.




Programming Microsoft. NET XML Web Services
Programming MicrosoftВ® .NET XML Web Services (Pro-Developer)
ISBN: 0735619123
EAN: 2147483647
Year: 2005
Pages: 172

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net