The Interpretation of Dreams by Sigmund Freud Chapter 5 Page 49

The legs in the dream recall an impression of the previous evening. He met a lady at a dancing lesson whom he wished to conquer; he pressed her to him so closely that she once cried out. After he had stopped pressing against her legs, he felt her firm responding pressure against his lower thighs as far as just above his knees, at the place mentioned in the dream. In this situation, then, the woman is the magnesium in the retort, which is at last working. He is feminine towards me, as he is masculine towards the woman.

If it will work with the woman, the treatment will also work. Feeling and becoming aware of himself in the region of his knees refers to masturbation, and corresponds to his fatigue of the previous day.... The rendezvous had actually been set for half-past eleven. His wish to oversleep and to remain with his