Set SOAPAction manually

Discussion in 'ASP .Net Web Services' started by 6kjfsyg02@sneakemail.com, Sep 25, 2007.

  1. Guest

    I am trying to manipulate a web service call so that the content of
    the SOAPAction header is read from a configuration file.

    I am overriding the GetWebRequest method of the generated proxy:

    protected override WebRequest GetWebRequest(Uri uri)
    {
    HttpWebRequest req = ( System.Net.HttpWebRequest)
    base.GetWebRequest(uri);
    req.Headers["Prueba"] = "Prueba1";
    return req;
    }

    In the sample code, you see I am inserting a "Prueba" header just for
    testing. I have of course tried with "SOAPAction".

    >From the debugger I see that the previous value of the headers is the

    UserAgent. After my setting, the headers include "Prueba: Prueba1" (or
    the SOAPAction value I set).

    However when I debug the call from a SOAPExtension I see that there
    are no values in SoapClientMessage.Headers collection. Not even the
    UserAgent! SoapClientMessage action has the value from the
    SoapDocumentMethod attribute of the Web method, not the one I am
    trying to set.
    This is so in the BeforeSerialize and the AfterSerialize stages.
    SoapVersion is Soap11.

    So what is the proper way to intercept and change the value of the
    SOAPAction HTTP header?

    Thanks in advance.

    --
    David Mediavilla.
     
    , Sep 25, 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. Abstract
    Replies:
    1
    Views:
    985
    Mike Schilling
    Oct 19, 2005
  2. =?Utf-8?B?TWlndWVsIElzaWRvcm8=?=

    Server did not recognize the value of HTTP Header SOAPAction

    =?Utf-8?B?TWlndWVsIElzaWRvcm8=?=, May 25, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    28,765
    =?Utf-8?B?TWlndWVsIElzaWRvcm8=?=
    May 25, 2007
  3. Markus Broy

    SoapException invalid SOAPAction

    Markus Broy, Aug 15, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    157
    sacrelegious
    Sep 1, 2003
  4. Juan Rodriguez

    Server did not recognize the value of HTTP Header SOAPAction

    Juan Rodriguez, Aug 28, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    164
    Juan Rodriguez
    Aug 28, 2003
  5. Hazzard
    Replies:
    3
    Views:
    235
    Hazzard
    Sep 13, 2003
Loading...

Share This Page