13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 13-2: The ASP.<strong>NET</strong> architecture to process page and Web service requests.The connection between the IIS process (the executable named <strong>in</strong>et<strong>in</strong>fo.exe) and theHTTP pipel<strong>in</strong>e (the worker executable named aspnet_wp.exe) is established through anamed pipe—that is, a W<strong>in</strong>32 mechanism <strong>for</strong> transferr<strong>in</strong>g data over a network. As you'dexpect, a named pipe works just like a pipe: you enter data <strong>in</strong> one end, and the samedata comes out at the other end. Pipes can be established both locally to connectprocesses and between remote mach<strong>in</strong>es.After the ASP.<strong>NET</strong> worker process receives a request, it routes that request throughthe .<strong>NET</strong> Framework HTTP pipel<strong>in</strong>e. The entry po<strong>in</strong>t of the pipel<strong>in</strong>e is the HttpRuntimeclass. This class is responsible <strong>for</strong> packag<strong>in</strong>g the HTTP context <strong>for</strong> the request, whichis noth<strong>in</strong>g more than familiar Active Server Pages (ASP) objects such as Request,Response, Server, and the like. These objects are packed <strong>in</strong>to an <strong>in</strong>stance of theHttpContext class, and then a .<strong>NET</strong> Framework application is started.The WebService ClassIn the .<strong>NET</strong> Framework, a Web service is an ord<strong>in</strong>ary class with public and protectedmethods. The Web service class is normally placed <strong>in</strong> a source file that is saved with an.asmx extension. Web service files must conta<strong>in</strong> the @ WebService directive that<strong>in</strong><strong>for</strong>ms the ASP.<strong>NET</strong> run time about the nature of the file, the language <strong>in</strong> usethroughout, and the ma<strong>in</strong> class that implements the service, as shown here:The Language attribute can be set to C#, VB, or JS. The ma<strong>in</strong> class must match thename declared <strong>in</strong> the Class attribute and must be public, as shown here:457

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!