I'm trying to write a console app in VS2010/.NET4 that connects to a web service but I'm having a problem with the Session variable.
I've already tested connecting to the web service with a ASP.NET web page with this,
When I try to write this out in a console app project, Session is showing as not declared.
I've tried to import System.Web but all VS2010 gives me is AspNetHostingPerm... And {}Services (no httpcontext).
Any help appreciated.
Cheers
Seán.
I've already tested connecting to the web service with a ASP.NET web page with this,
Imports System.Net
Dim PMS as New PM1.PWSService ' PM1 added as Web Reference.
Dim cookiejar As CookieContainer ' to save session
If IsNothing(Session("CookieJar")) Then
PMS.login(user, pass)
Dim PMS as New PM1.PWSService ' PM1 added as Web Reference.
Dim cookiejar As CookieContainer ' to save session
If IsNothing(Session("CookieJar")) Then
cookiejar = New CookieContainer
Elsecookiejar = Session("CookieJar")
End IfPMS.login(user, pass)
This works fine but this job will need to runs as a command line tool.When I try to write this out in a console app project, Session is showing as not declared.
I've tried to import System.Web but all VS2010 gives me is AspNetHostingPerm... And {}Services (no httpcontext).
Any help appreciated.
Cheers
Seán.