/// <summary> /// Call this method from a web service that needs to be closed. /// </summary> public static void RemoveHandler(IClosableWeb H) { ClosableModule M = Closer; if (M != null) { M.StopHandle(H); } }
///<summary> ///Default constructor, opens the connection. Checks to see if the class is ///initialized, and initializes it first if not. ///</summary> public SqlWebService() { Type T = this.GetType(); if (ConnectionString == null) { GetConnectionInfo(T.Name); } InitializeComponent(); ClosableModule.SetHandler(this); }
/// <summary> /// Constructor gets the Service name and credentials from the config file. /// </summary> public SoapHttpClientProtocol() : base() { ClosableModule.SetHandler(this); Type T = this.GetType(); if (UrlCache[T.Name] == null) { GetUrlInfo(T); } Initialize(); }
/// <summary> /// Call this method from a web service that needs to be closed. Will throw /// an exception if module isn't installed. /// </summary> public static bool SetHandler(IClosableWeb H) { ClosableModule M = Closer; if (M == null) { throw new Exception("ClosableModule is not installed."); } else { M.Handle(H); } return(M != null); }
/// <summary> /// Closes the connection and rollsback any open transaction. /// </summary> public virtual void Close() { if (!ExtTrans) { if (Transaction != null) { Transaction.Rollback(); } Transaction = null; if (oConn != null && oConn.State != ConnectionState.Closed) { oConn.Close(); } } oConn = null; TransIndex = 0; ExtTrans = false; ClosableModule.RemoveHandler(this); }
/// <summary>Closes any open connections.</summary> public void Close() { if (LocalService != null) { if (!InCall) { if (typeof(IClosableWeb).IsInstanceOfType(LocalService)) { ((IClosableWeb)LocalService).Close(); } LocalService = null; } else { CloseCalled = true; } } ClosableModule.RemoveHandler(this); }