water dispenser not working, but still making ice

Our problem started well over a year ago, the water dispenser works occasionally. I have to keep my freezer compartment empty so I can turn it on and off for hours at a time. Its almost like the water line freezes and have to defrost it. The water will dispense for a day or so and then stop again. Has anyone else experienced this.