Summary


As you’ve seen in this chapter, HTTP modules and SOAP extensions have a fair amount in common. For example, they are both relatively simple to implement and can be reused in any number of Web applications. You can even use them together in the same application. However, they both come with a tradeoff between power and flexibility, which will affect your choice of which one to use in your projects.

HTTP modules have full access to the processing of any HTTP request or response related to an application, but they can’t be deployed on a client. They are “all or nothing” in two ways: they process either every request and response or none at all, and the onus is on you to code every aspect of the module’s workings.

SOAP extensions, on the other hand, use ASP.NET’s WebMethod API. This means you get help with certain aspects of your coding (such as error handling) and can develop your applications faster. SOAP extensions give you a choice of deployment options—autonomous or targetable—on the server, and they can be included on the client as well. Their flexibility comes with some disadvantages, however. They work only with SOAP requests to Web services, and only requests that are handled by the default ASMX handler. That means you can’t even test them with the service’s default documentation page.

We looked at the differences between HTTP modules and SOAP extensions and discussed the tasks best suited to each. Both give you access to a set of events that you can hook into and perform a task. You also learned how to set a pecking order among multiple modules in the same application by using the priority attribute, and how to use the same approach when you use multiple extensions in one place.

Finally, we looked at the key properties and methods you must implement for your modules and extensions to work. You learned what they do, when to use them, and how they tie into the lifetime of the SOAP message they are processing.

In later chapters, you’ll see that quite a few of the higher-level tasks for the Web services framework are implemented using one or both of these add-on components. You’ll also find some components of both types scattered about on the Web. Check out http://www.newtelligence.com/ for a good start, and go to http://www.newtelligence.com/downloads/SoapExtensionWizard-0-1.zip for a handy SOAP extension wizard for Visual Studio .NET.




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