473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Centralize SOAPHeader Processing?

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!

--
sp**********@rogers.com (Do not e-mail)
Jun 27 '08 #1
1 968
"Spam Catcher" <sp**********@rogers.comwrote in message
news:Xn**********************************@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
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: justin_sun | last post by:
All the sample code that I can find on SoapHeader is at least one level down within a root node. However, I'm working on a project needs to create a soap header like this: <SOAP-ENV:Header>...
0
by: Mannfred | last post by:
I've written a complex web service in C# to be used by SmartDevices and I'm trying to reduce size of the message to the absolute minimum to save on cost, every byte counts etc. Is there any way...
10
by: Andy Kendall | last post by:
I have a problem accessing my custom SoapHeader from a SoapExtension. My extension has no compile time reference to the class derived from SoapHeader, so how can cast it into a SoapHeader of the...
0
by: Fred | last post by:
I am trying to build a consumer to a webservice which use soapheader. I am using Visual Studio 2003. Please see the wsdl-file below. Why is it that the SOAPHEADER is empty when I use it int the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.