Mit WCF-Client + Cookies Webservice-Anrufe tätigen

Implementierung derBasic security Authentication in einemWCF Service.

Schaffte es, die zu bekommen.ASPXCookie vom Webservice. Aber wie kann ich den empfangenen Cookie an die nächste Anfrage weitergeben?

            var authClient = new MovieDbClient();
            using (new OperationContextScope(authClient.InnerChannel))
            {
                isValid = authClient.Login("userName", "passWord*");
                if (isValid)
                {
                    var response = (HttpResponseMessageProperty)OperationContext.Current.IncomingMessageProperties[HttpResponseMessageProperty.Name];
                    sharedCookie = response.Headers["Set-Cookie"];
                }
            }

Ich habe versucht, die auszudruckenSharedCookie und war darin erfolgreich. Es sieht ungefähr so aus,

".ASPXAUTH=E499CA76EAC178A96BE5CA1E314CC90E0A6F9B95AD221EF5AD7D43598E701DC034D40904DBB8ECFBFB3EA21F2597D3C8DAB9B19A0491FD5858E9F0A4B6DC6E6A980FBB4CCADE191855A029CF8236C6890BEE28665C236992632807D1021AA138; expires=Tue, 07-Jan-2014 06:22:22 GMT; path=/; HttpOnly"

Die Frage isthow do I pass this cookie information in my next request using wCF Client - authClient ?

Antworten auf die Frage(1)

Ihre Antwort auf die Frage