Question

I have a wpf application that connects to a soap web service and I need it to connect to any number of locations for this web service so I am allowing the user to type in the URL in a textbox and it gets saved in the Properties.Settings. I am then setting the Endpoint.Address to the url. It all works except for one thing, the web service uses ASP.net sessions to validate that the application is logged in so the service be set to allow cookies = true. I have it set in the app.config of my wpf application under Binding but for some reason the cookie is not being managed anywhere. When I use Fiddler I can see where the cookie is set in a return request from the service but the client isn't saving/using that cookie across web service methods.

AdminWebServiceClient adminclient = new AdminWebServiceClient();
adminclient.Endpoint.Address = new EndpointAddress(MyWPFApp.Properties.Settings.Default["CurrentURL"] as string);

This does set the URL correctly but again, I'm losing the cookie somewhere as the request isn't keeping track of it and sending the 'ASP.NET_Sessionid' cookie to the service to identify who is sending this service request. Anyone have any ideas on how to get the cookie when it's set and manage it? Thanks!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top