how to track webservice usage?

A

Alex Vincent

All,

Does anyone have a tried and tested method of tracking
usage of their webservice - more importantly a method of
persisting the Reqest/Response classes (if you've gone
down the object route) in SQL or the filesystem?

Whilst I expose the webservice initially to my users, I
want to check/'spy-on' what requests are
incoming/outgoing...

cheers if anyone has any suggestions!

alex
 
D

Dino Chiesa [MSFT]

Have you considered using a web service extension?

The idea is you can add your own custom attribute to a webmethod, and
provide the code that implements the attribute. This code can then log all
incoming webrequests, wherever it wants (SQL, event log, file system, etc)
as well as outgoing responses.

(NOTE: this works only with SOAP, not with HTTP-GET (eg, will not work with
ASMX test page invoked by a browser!!))

Here are a few references...

example source, logs to filesystem:
http://msdn.microsoft.com/library/e...bServicesProtocolsSoapExtensionClassTopic.asp

on the web.config syntax:

http://msdn.microsoft.com/library/e...nimportertypessoapextensionreflectortypes.asp

on the SoapExtension mechanism:

http://msdn.microsoft.com/library/e...bServicesProtocolsSoapExtensionClassTopic.asp

on the anatomy of an xml web service call:

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconanatomyofsoapwebservicelifetime.asp

on altering a soap call:

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconalteringsoapmessageusingsoapextensions.asp


-Dino
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top