Use of SoapHeaders
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngwebservices' list.


Alwin Jeyakumar
Hello All,
I am developing a web service. And I need to send
some common information (ClientId, CustomerId etc) in
each of the Web Methods. So I am thinking of putting
those common parameters in a SoapHeader. Can anyone
please tell me if there are any other advantages I get
when I use SoapHeader in .NET. Also if the client is
going to use it and set the SoapHeaders for each
WebMethod, is there a way they could set for the
entire Webservice level, instead of setting for each
WebMethod level.

Thanks,
Alwin

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

Reply to this message...
 
    
Paul John Gibbons
Hi Alwin,

If this is context information needed by the service rather than just a
convenient way to pass common parameters this seems very appropriate. I
realize this distinction is almost splitting hairs, but the difference
between doing what is right and what is easy so often is.

Setting up and processing the header can be performed in a
SoapExtension. This is a convenient way to install common logic without
inserting a call into every method. You probably still want to define
the SoapHeader in the attributes for each method in the server or you'll
be parsing the XML in the header yourself as part of the extension.

You can specify that an extension be used for all methods in the service
using the configuration file rather than the attributes used in most
examples.

The extension is not defined in the WSDL so it is not automatically
generated or used on the client. You can specify it be used in the
application configuration file, but doing so specifies its use for every
web service call made by the client - not just those to your service.

If you need more detail please let me know and I'll be happy to oblige.

Paul Gibbons
Author of ".NET Development for Java Programmers"
Click here to reveal e-mail address

-----Original Message-----
From: Alwin Jeyakumar [mailto:Click here to reveal e-mail address]
Sent: Wednesday, July 31, 2002 12:52 PM
To: aspngwebservices
Subject: [aspngwebservices] Use of SoapHeaders

Hello All,
I am developing a web service. And I need to send
some common information (ClientId, CustomerId etc) in
each of the Web Methods. So I am thinking of putting
those common parameters in a SoapHeader. Can anyone
please tell me if there are any other advantages I get
when I use SoapHeader in .NET. Also if the client is
going to use it and set the SoapHeaders for each
WebMethod, is there a way they could set for the
entire Webservice level, instead of setting for each
WebMethod level.

Thanks,
Alwin

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

| [aspngwebservices] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebservices.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Web.Services.Protocols.SoapExtension
System.Web.Services.Protocols.SoapHeader




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com