Carrier phase measurements are extremely accurate but ambiguous. The reliability of the resolution of this ambiguity is often not sufficient due to the the small carrier wavelength of 19 cm and multipath. There are two options for improving the reliability of integer least-squares estimation: (1) multi-frequency widelane combinations that increase the wavelength to several meters, and (2) constraints on the length and orientation of the baseline which reduce the size of the search space. This paper focuses on the second aspect, and provides a soft constrained integer least-squares estimator, i.e. a method that uses a priori information on the length and orientation of the baseline to improve the ambiguity resolution and also ensures a sufficient robustness with respect to uncertainties in the a priori information. This opens up new opportunities for applications such as freight stabilization on cranes and helicopters or attitude determination of aircrafts. In all these applications, the length and orientation are constrained but not fixed. This paper suggests two approaches for soft constrained integer least-squares estimation: The first one includes a priori information on the length of the baseline and its orientation (attitude) in the form of Gaussian distributions. The second one includes the a priori information by inequality constraints on the length and orientation. This information could come from physical constraints (e.g. gravity) or other sensors. Both approaches are solved iteratively with the Newton method. The benefit of the a priori information depends on its variance or on the tightness of the inequality constraints. This paper shows that the new methods reduce the probability of wrong fixing with respect to unconstrained integer least-squares estimation by more than one order of magnitude even if the a priori information on the length is biased by 1 m. The proposed method is evaluated with both simulated and real measurements from PolaRx3G receivers of Septentrio.