class Program { static void Main(string[] args) { AuthenticationServiceClient asc = new AuthenticationServiceClient(); string cookies = ""; using (OperationContextScope scope = new OperationContextScope(asc.InnerChannel)) { asc.Login(username, password, null, false); var p = OperationContext.Current.IncomingMessageProperties; var responseProperties = p[HttpResponseMessageProperty.Name] as HttpResponseMessageProperty; cookies = responseProperties.Headers[HttpResponseHeader.SetCookie]; } cookies = ConstructCookies(cookies); PrimeServiceClient psc = new PrimeServiceClient(); using (OperationContextScope scope = new OperationContextScope(psc.InnerChannel)) { var p = new HttpRequestMessageProperty(); OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, p); p.Headers.Add(HttpRequestHeader.Cookie, cookies); Console.WriteLine(psc.NextPrime(3)); } using (OperationContextScope scope = new OperationContextScope(asc.InnerChannel)) { var p = new HttpRequestMessageProperty(); OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, p); p.Headers.Add(HttpRequestHeader.Cookie, cookies); asc.Logout(); } } private static string ConstructCookies(string cookie) { // snipped... we will use the extension methods below } }