Exact solution of the Schrodinger equation for photoemission from a metal