O'Reilly logo

Real World XML Web Services: For VB and VB .NET Developers by Yasser Shohoud

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10.4. Usage Accounting

The next SOAP extension we'll build is for usage accounting or metering. The idea is to intercept each incoming request and log it to the AccountUsage database table with the userid, method name, and request time. It would also be nice if the extension could optionally log the time that the response was sent back to the client. That way you also get an idea of how long each method invocation took. Listing 10.8 shows the Accounting SOAP extension implementation.

Listing 10.8. The usage accounting SOAP extension (VBWSBook\Chapter10\Infrastructure\Accounting.vb)
 Public Structure AccountingExtensionConfig Public ConnStr As String Public LogResponse As Boolean End Structure Public Class Accounting Inherits System.Web.Services.Protocols.SoapExtension ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required