Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Set SOAPAction manually

Reply
Thread Tools

Set SOAPAction manually

 
 
6kjfsyg02@sneakemail.com
Guest
Posts: n/a
 
      09-25-2007
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.

 
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
Server did not recognize the value of HTTP Header SOAPAction =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= ASP .Net 2 05-25-2007 10:41 PM
SOAPAction Header Deprecated - how to Distinguish SOAP from HTTP request? Abstract Java 1 10-19-2005 12:06 AM
Unhandled exception: Server did not recognize the value of HTTP Header SOAPAction Hazzard ASP .Net Web Services 3 09-13-2003 01:51 PM
SoapException invalid SOAPAction Markus Broy ASP .Net Web Services 1 09-01-2003 05:20 AM
Server did not recognize the value of HTTP Header SOAPAction Juan Rodriguez ASP .Net Web Services 0 08-28-2003 02:44 PM



Advertisments