static void Main(string[] args) { WebServiceClient Client = new WebServiceClient(); Console.WriteLine(Client.Factorial(3)); Client.Close(); }
public void Close() { lock (_clientLock) { if (_client != null) { try { if (_client.State == CommunicationState.Opened) { _client.Close(); } _client.Abort(); } catch { // Ignore errors on disconnect } } } }