Self-consistent solutions of microscopic Eilenberger theory are presented for a two-dimensional model of a superconducting channel with a geometric constriction. Magnetic fields, external ones as well as those caused by the supercurrents, are included and the relevant equations are solved numerically without further assumptions. Results concerning the influence of temperature, geometric parameters, of $kappa=lambda_L/xi_0$ and of external magnetic fields on the Andreev bound states in the weak link and on the current-phase relation are presented. We find that the Andreev bound states within the junction obtain peculiar substructure when a finite supercurrent flows. As long as the London penetration depth is comparable to or bigger than the extension of the constriction, the Josephson effect is independent of $kappa$. Furthermore, the weak link is very insensitive to external magnetic fields. Features restricted to a self-consistent calculation are discussed.