public void TestRestoreConnection() { WSWebService.WorkstationWebServiceClient webService = ServerConnection.Instance.GetWorkstationWebService(); webService.Close(); webService = ServerConnection.Instance.RestoreConnection(); Assert.NotNull(webService, "ServerConnectionTest:TestRestoreConnection() #01"); Assert.AreEqual(System.ServiceModel.CommunicationState.Created, webService.State, "ServerConnectionTest:TestRestoreConnection() #02"); webService.Open(); Assert.AreEqual(System.ServiceModel.CommunicationState.Opened, webService.State, "ServerConnectionTest:TestRestoreConnection() #03"); }
private ServerConnection() { // Build the connection to the WorkstationWebService webService = new WSWebService.WorkstationWebServiceClient("BasicHttpBinding_IWorkstationWebService"); }
public WSWebService.WorkstationWebServiceClient RestoreConnection() { // Restore the connection. webService = new WSWebService.WorkstationWebServiceClient("BasicHttpBinding_IWorkstationWebService"); return(webService); }