public saveSession ( ApplicationSession session ) : gov.va.medora.mdws.dto.BoolTO | ||
session | ApplicationSession | The session object to save |
return | gov.va.medora.mdws.dto.BoolTO |
/// <summary> /// Using the configured SQL connection string, opens a connection to the database and attempts /// to wrtie a record from the ApplicationSessions table /// </summary> /// <returns>BoolTO with true value if read was successful, FaultTO otherwise</returns> public BoolTO canWrite() { UsageDao dao = new UsageDao(_connectionString); string sessionId = gov.va.medora.utils.StringUtils.getNCharRandom(24); ApplicationSession session = new ApplicationSession(sessionId, System.Net.IPAddress.Loopback.ToString(), DateTime.Now); session.End = DateTime.Now; session.LocalhostName = System.Net.IPAddress.Loopback.ToString(); ApplicationRequest request = new ApplicationRequest(sessionId, new Uri("http://mdws.va.gov/getSomething"), DateTime.Now, DateTime.Now, "<Soap>...</Soap>", "<Soap>...</Soap>"); session.Requests.Add(request); dao.saveSession(session); return(dao.deleteSession(sessionId)); }
/// <summary> /// Using the configured SQL connection string, opens a connection to the database and attempts /// to wrtie a record from the ApplicationSessions table /// </summary> /// <returns>BoolTO with true value if read was successful, FaultTO otherwise</returns> public BoolTO canWrite() { UsageDao dao = new UsageDao(_connectionString); string sessionId = gov.va.medora.utils.StringUtils.getNCharRandom(24); ApplicationSession session = new ApplicationSession(sessionId, System.Net.IPAddress.Loopback.ToString(), DateTime.Now); session.End = DateTime.Now; session.LocalhostName = System.Net.IPAddress.Loopback.ToString(); ApplicationRequest request = new ApplicationRequest(sessionId, new Uri("http://mdws.va.gov/getSomething"), DateTime.Now, DateTime.Now, "<Soap>...</Soap>", "<Soap>...</Soap>"); session.Requests.Add(request); dao.saveSession(session); return dao.deleteSession(sessionId); }