Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Centralize SOAPHeader Processing?

Reply
Thread Tools

Centralize SOAPHeader Processing?

 
 
Spam Catcher
Guest
Posts: n/a
 
      04-17-2008
Hi all,

In an ASP.NET web service, is there a way I can centralize processing of
SOAP Headers?

Currently I need to nput my header logic into each webmethod - is there an
event, mechanism, extension, etc I can hook into to do all my processing
before the webmethod is executed?

Thanks!

--
(Do not e-mail)
 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      04-21-2008
"Spam Catcher" <> wrote in message
news:Xns9A83112EB8527usenethoneypotrogers@127.0.0. 1...
> Hi all,
>
> In an ASP.NET web service, is there a way I can centralize processing of
> SOAP Headers?
>
> Currently I need to nput my header logic into each webmethod - is there an
> event, mechanism, extension, etc I can hook into to do all my processing
> before the webmethod is executed?


There's no general way to do this. However, you can apply various design
patterns to save some effort.

I don't know a name for the following pattern, but here's what I did for one
web service. I abstracted the web methods into classes. Each web method had
its own little class. I was then able to consider what was in common among
several of the classes - for instance, header processing. That which was in
common got moved into a base class.

This left my .ASMX.cs file as nothing more than a façade. Each web method
simply instantiated the corresponding "service layer" class, passing the web
method parameters into the constructor call. It then called the "Execute"
method of the class. Execute was a method on the base class. It called a
virtual PreProcess method, then a virtual ExecuteImplementation method, then
a virtual PostProcess method. Certain derived classes would override
PreProcess (for instance, to process a particular set of SOAP Headers), and
ExecuteImplementation to impose a common processing pattern.

This allows specialization of classes to correspond to specialization of
behavior.

This was also done in a bit of a hurry. I'm sure others can do better.

--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centralize SOAPHeader Processing? Spam Catcher ASP .Net 1 04-21-2008 06:47 PM
Centralize app_themes Chris Roden ASP .Net 0 04-16-2007 10:31 PM
How to centralize the page? Laura Computer Support 0 07-20-2006 08:24 PM
Centralize exception handling =?Utf-8?B?QXR1bCBCYWhs?= ASP .Net 4 07-19-2005 07:21 PM
Centralize Thunderbird Address Book Thomas Guignard Firefox 2 01-21-2005 01:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57