I realize this is a question that's been asked time and again, but I can't find a list of "gotchas" that I can take a look at.
I'm writing a WCF client that will consume an SAP web service, using a customBinding in my web.config with allowCookies set to false and support for reliable sessions enabled. I'm setting my HTTP headers as follows:
var authCookie = new System.Net.Cookie();
var wcfClient = new SomeWcfClient();
using (var context = new OperationContextScope(wcfClient.InnerChannel))
{
var cookies = new CookieContainer();
cookies.Add(authCookie);
var endPoint = new EndpointAddress("http://someDomain.test/");
var httpRequest = new System.ServiceModel.Channels.HttpRequestMessageProperty();
OperationContext.Current.OutgoingMessageProperties.Add(System.ServiceModel.Channels.HttpRequestMessageProperty.Name, httpRequest);
httpRequest.Headers.Add(HttpRequestHeader.Cookie, cookies.GetCookieHeader(endPoint.Uri));
wcfClient.PerformOperation();
}
When I use Fiddler, my HTTP header does not come across. I've tried creating dummy Referer and User-Agent headers, too, thinking that maybe something specific was happening with my cookie header, but even those other headers did not come across. Any thoughts? Where should I look next?