13.5. Usage Accounting

Usage accounting can also be implemented by simply applying the usage accounting SOAP extension built in Chapter 10. You do this by adding the Accounting attribute to each method for which you want to track usage accounting. Assuming you already applied the security extension, you don't need to do anything else to apply usage accounting. Listing 13.6 shows the GetTemperature and GetWeather methods with the Accounting attribute added.

Listing 13.6. Applying the security and SOAP extensions using attributes (VBWSBook\Chapter13\Weather.asmx.vb)
 <WebMethod(), _ SoapDocumentMethod( _ Binding:="WeatherInterface", _ Action:="", _ ParameterStyle:=SoapParameterStyle.Bare), _ SoapSecurity("Temperature"), _ SoapHeader("sessHdr", ...

Get Real World XML Web Services: For VB and VB .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.