[en] The magnetic field created by a vortex line located near a macroscopic spherical cavity as well as the magnetic field within the superconductor are calculated by solving London equations using the generalized spherical function technique. The interaction energy between the flux line and the cavity and consequently the pinning force were also calculated. It is shown that one possible cause of the pinning is that an attractive image force exists at the superconductor sphere boundary. (author)