.NET Core WCF Web Service with Cookies

Cris 21 Reputation points

Hi I have an app that calls a webservice and its been added as a reference but it needs to send the cookie information to be able to access the methods. Does anyone know how to do that? Thanks.

Microsoft Technologies based on the .NET software framework.
3,534 questions
A set of technologies in the .NET Framework for building web applications and XML web services.
4,294 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Cris 21 Reputation points

    I need to pass a session cookie to the web service before it allows me to use the method

    using (WebServiceClient webservice = new WebServiceClient(WebServiceClient.EndpointConfiguration.WSHttpBinding_IWebService))
    GetRequest inReq = new GetRequest();
    GetResponse outRes = new GetResponse();

          inReq.Test1 = true;
          inReq.Test2 = true;
          outRes = webservice.GetContext(inReq);   .....

    how do I insert Cookie? Thanks

    0 comments No comments

  2. Bruce (SqlWork.com) 59,306 Reputation points

    you first need to read the cookie. from the server. you need a server url that will create and return the cookie. you then save the cookie and use in later calls.

    passing the cookie is a little tricky:


  3. Cris 21 Reputation points

    I am still getting errors intermittently

    service is unavailable This could be because the service is too busy or because no endpoint was found listening at the specified address...

    I think it could be because of maxConcurrentSessions or maxConcurrentInstances

    Anyone know how to set this in appsettings.json? Thanks I appreciate it

    0 comments No comments