Metonymy is when one thing is referred to as another related thing. An example would be referring to the U.S. federal government as the Capitol. (Tangentially related: Synecdoche.)
Prosopopoeia is the personification of inanimate things or non-present people. For example, the flames of the fire danced in the wind.
The two should not be confused.*
* Adapted from an earlier, private discussion over GTalk.
The Web thanks you for the lesson.