Noneikonal approach to the scattering of hadrons from nuclei I. General theory