  We generalize the Shimura-Waldspurger correspondence, which describes the
generic part of the automorphic discrete spectrum of the metaplectic group
$\mathrm{Mp}_2$, to the metaplectic group $\mathrm{Mp}_{2n}$ of higher rank. To
establish this, we transport Arthur's endoscopic classification of
representations of the odd special orthogonal group $\mathrm{SO}_{2r+1}$ with
$r \gg 2n$ by using a result of J. S. Li on global theta lifts in the stable
range.
