mikefourie-zz / MSBuildExtensionPack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[enhancement] HttpWebRequest: allow to add HTTP headers (e.g. 'SOAPAction')

o7g8 opened this issue · comments

Hello,

I have a case where it would be handy to call a SOAP service from MSBuild using the HttpWebRequest task. Unfortunately the service expects the SOAPAction header (it's common for SOAP services to expect the header). Unfortunately it's not possible to supply additional HTTP headers in the current HttpWebRequest implementation.

In order to verify my assumption about the necessity of SOAPAction header, I have experimented with curl. I have found an absolute minimum of overridden HTTP headers, which are sufficient for getting a valid response from the SOAP service:

curl -X POST -H 'SOAPAction: "MyAction"' -H 'Content-Type: text/xml;charset=UTF-8' -d @soap_payload.xml http://myserver:myport/MyService/