How to Add dynamic header in SoapExtension

Discussion in 'ASP .Net Web Services' started by gilad, Mar 19, 2007.

  1. gilad

    gilad Guest

    Hi,
    I would like to add header in BeforeSerialize of ProcessMessage in the
    SoapExtension.

    I know I can prepare:
    public class TestHeader : SoapHeader
    {
    public string userName;
    public string password;
    }

    put values and set in SoapMessage.Headers.Add(TestHeaders Class). what
    happen if I want the code to be generic and base on some rules
    sometimes add some more values to TestHeader ... isn't there a way to
    simply:
    Add("TestHeader1", "key1", "value1")
    Add("TestHeader1", "key2", "value2")

    Add("TestHeader2", "key1", "value1")

    Thanks,
    Gilad.
     
    gilad, Mar 19, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. fred carter

    SoapExtension & Http headers

    fred carter, Apr 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    799
    fred carter
    Apr 2, 2004
  2. Ted A W
    Replies:
    0
    Views:
    379
    Ted A W
    Jan 12, 2006
  3. mlt
    Replies:
    2
    Views:
    883
    Jean-Marc Bourguet
    Jan 31, 2009
  4. Ben

    SoapExtension and header information

    Ben, Nov 11, 2004, in forum: ASP .Net Web Services
    Replies:
    5
    Views:
    199
  5. cordata5

    Encrypting XML header via SoapExtension issues

    cordata5, Nov 19, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    161
    Dan Rogers
    Nov 19, 2004
Loading...

Share This Page