There is a ASP.NET Web Service which uses SessionState. Let's see it's 2 methods:
[WebMethod(EnableSession = true)]
public string SetUser(string userName)
{
return UserName = userName;
}
[WebMethod(EnableSession = true)]
public string GetUser()
{
return UserName;
}
private string UserName
{
get
{
return Session[Consts.UserNameKey].ToString();
}
set
{
Session[Consts.UserNameKey] = value;
}
}
when I test these methods (SetUser, then GetUser) through browser via local ASP.NET Server and then on IIS, it works right.
I created browser-enabled InfoPath form and call SetUser with InfoPath function userName() parameter value and then call GetUser in Form Open rules set.
In preview mode it also works right, but when I deploy form into Office Forms Server, GetUser returns "Object reference not set to an instance of an object".
What I need to correct here?