The interaction of nonlinear Schrödinger solitons with extended inhomogeneities, modeled by potential wells with different shapes, is investigated numerically. For fixed initial velocities below the transmission threshold, the scattering pattern as a function of the width of the well exhibits periodically repeating regions of trapping, transmission, and reflection. The observed effects are associated with excitation and a following resonant deexcitation (in the cases of escape) of shape oscillations of the solitons at the well boundaries. The analysis of the oscillations indicates that they are due to interference of the solitons with emitted dispersive waves.