locked
Get WCF Client Cookies in Windows Phone 7.1 RRS feed

  • Question

  • Hi,

    I tried to get the cookies from WCF client with OperationContext just like in my ASP.NET project, but OperationContext.Current is null when Async method is completed.

    Is there any other way to get cookies from WCF client in Windows Phone 7.1 SDK

    Thanks in advance

    Monday, November 21, 2011 8:38 PM

Answers

  • Hello, do you mean you want to get cookies on the client? It won't be easy if you use WCF. But if you're invoke a REST service using standard HttpWebRequest, you can work with cookies using HttpWebRequest.CookieContainer.GetCookies.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.
    • Marked as answer by Yi-Lun Luo Monday, November 28, 2011 11:36 AM
    Wednesday, November 23, 2011 3:23 AM

All replies

  • No, you cannot get cookies from WCF client for Windows Phone 7.1 SDK. The ASP.NET and Windows Phone 7.1 SDK are different platforms; hence, a message error is sent as null. The only way to "get" cookies for Windows Phone 7.1 SDK is to develop them.~Christine.
    Christine Sindelar
    Monday, November 21, 2011 10:06 PM
  • Hello, do you mean you want to get cookies on the client? It won't be easy if you use WCF. But if you're invoke a REST service using standard HttpWebRequest, you can work with cookies using HttpWebRequest.CookieContainer.GetCookies.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.
    • Marked as answer by Yi-Lun Luo Monday, November 28, 2011 11:36 AM
    Wednesday, November 23, 2011 3:23 AM
  • There are so many methods and it will be difficult to implement all as REST service. So is there any way to use both at the same time?

    I mean, if I use REST service for the first method to get cookies. Then, will I be able to use WCF methods if I add the cookies to CookieContainer of WCF client object?

    Thanks

    Monday, November 28, 2011 6:07 PM