Chapter 5: Raw Handlers and Clients


Overview

So far in this book, we’ve looked at the netwide standards that comprise the Web services base platform. Indeed, we have one more standard—XML Schema—to look at in the next chapter before we complete this section on core technologies. But first we’ll take a step into the Microsoft .NET camp and look at the constructs that underlie .asmx Web service pages and their clients.

“Excuse me? I seem to have a bit of a dirty fork.”

—Monty Python

Take a look at something you’ve worked hard on and you’ll always find some reason to tweak it some more. There’s always that speck of dirt on your nice clean fork. The same is true of the .NET team and the Web method abstraction they created over the workings of Web services. It works fine a lot of the time, but there are plenty of situations in which you’ll want to bypass it and work at a lower level.

If you’ve used ASP.NET fairly extensively, you’ve probably come across the ASP.NET handler—the piece of code that takes in all the requests to your Web application, processes them, and builds a response to send back to the client. You might even have needed to write a custom handler for requests to one of your Web applications. The .NET Framework provides a standard handler for Web services that translates (deserializes) SOAP messages into objects and method calls that the service can understand. This is the dirty fork we need to clean, and we can do that by creating our own handler to field SOAP requests as they appear. In a similar fashion, we can choose not to use the proxy class that Microsoft Visual Studio .NET generates for us and go it alone on the client as well.

In this chapter, we’ll look at the following topics:

  • Why you sometimes need to build your own handlers

  • How handlers fit into the HTTP pipeline modeled by the .NET Framework

  • How the default Web service handler works and where you can make changes to your own client to add functionality

  • How to implement your own proxy class on the client side

The actual code isn’t that difficult, but the theory is important. Knowing how Web service requests are processed will provide a cornerstone for Part III of this book.




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