Properly disposing of a WCF connection using IDisposable
The adviced way to call a service endpoint when the connection is not an open stream, is to have the lifecycle of you client in line with the operation you are calling.

So rather than storing an instance of the client..


private WebService()
    {
        client = new MyWebServiceContractClient();
    }



You should create a client on demand. To work around the known issue on Dispose, a solid solution is available.

public double GetAnswer()
    {     
        try
        {
            using (new MyWebServiceContractClient()) {

                //do some work
                return answer;
            } // &lt;- there is a known issue here: https://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
            return -1;
        }
    }