M
moondaddy
This code is all executed on my dev machine running winXP sp2 and VS2005.
I have a winforms 2.0 app that calls a web service wich caches a GUID for a
short time like this:
[WebMethod(Description = "Get ticket for web page"),
SoapHeader("Credentials")]
public string GetWebPageTicket(string CurrentObject)
{
Guid CacheID = Guid.NewGuid();
Methods.ErrLog(CacheID.ToString(), false, false);
SessionData obj = new SessionData();
obj.UserID = 1;// _credentials.UserID;
obj.CurrentObject = CurrentObject;
HttpRuntime.Cache.Insert(CacheID.ToString(), obj, null,
DateTime.Now.AddMinutes(2), System.Web.Caching.Cache.NoSlidingExpiration);
//HttpRuntime.Cache.Add(CacheID.ToString(), obj, null,
DateTime.Now.AddSeconds(60), TimeSpan.Zero,
System.Web.Caching.CacheItemPriority.Default, null);
return CacheID.ToString();
}
This web service returns the GUID back to the client where the client then
calls a aspx page and passes the GUID in as a parameter like this:
private void button1_Click(object sender, EventArgs e)
{
eVIPNow.eVIPNow_Gen_DAL obj = new eVIPNow.eVIPNow_Gen_DAL();
// GetWebPageTicket calls the WS and returns the GUID
string str = obj.GetWebPageTicket("xyz");
string url = ConfigurationManager.AppSettings["HelpPath"] +
"app/SuggestionLog.aspx?Param=" + str;
// This is where we call the aspx page
System.Diagnostics.Process.Start(url);
}
Now in the aspx page I run this code in and effort to find the cached GUID
from the WS:
// See if we can find the param in our cache
_sessionData = (SessionData)HttpRuntime.Cache[param];
where param is the GUID string value. this code returns null and
HttpRuntime.Cache has zero items in it. its almost like the WS and aspx
page are hitting 2 different instances of IIS.
I have very similar code running in another app which uses vb 1.1 and it
works good.
Any ideas why this doesnt work?
Thanks.
I have a winforms 2.0 app that calls a web service wich caches a GUID for a
short time like this:
[WebMethod(Description = "Get ticket for web page"),
SoapHeader("Credentials")]
public string GetWebPageTicket(string CurrentObject)
{
Guid CacheID = Guid.NewGuid();
Methods.ErrLog(CacheID.ToString(), false, false);
SessionData obj = new SessionData();
obj.UserID = 1;// _credentials.UserID;
obj.CurrentObject = CurrentObject;
HttpRuntime.Cache.Insert(CacheID.ToString(), obj, null,
DateTime.Now.AddMinutes(2), System.Web.Caching.Cache.NoSlidingExpiration);
//HttpRuntime.Cache.Add(CacheID.ToString(), obj, null,
DateTime.Now.AddSeconds(60), TimeSpan.Zero,
System.Web.Caching.CacheItemPriority.Default, null);
return CacheID.ToString();
}
This web service returns the GUID back to the client where the client then
calls a aspx page and passes the GUID in as a parameter like this:
private void button1_Click(object sender, EventArgs e)
{
eVIPNow.eVIPNow_Gen_DAL obj = new eVIPNow.eVIPNow_Gen_DAL();
// GetWebPageTicket calls the WS and returns the GUID
string str = obj.GetWebPageTicket("xyz");
string url = ConfigurationManager.AppSettings["HelpPath"] +
"app/SuggestionLog.aspx?Param=" + str;
// This is where we call the aspx page
System.Diagnostics.Process.Start(url);
}
Now in the aspx page I run this code in and effort to find the cached GUID
from the WS:
// See if we can find the param in our cache
_sessionData = (SessionData)HttpRuntime.Cache[param];
where param is the GUID string value. this code returns null and
HttpRuntime.Cache has zero items in it. its almost like the WS and aspx
page are hitting 2 different instances of IIS.
I have very similar code running in another app which uses vb 1.1 and it
works good.
Any ideas why this doesnt work?
Thanks.