The accuracy of localization in wireless sensor networks depends on noise level and the presence of nonline of sight (NLOS) connections. In this letter, we propose a novel semidefinite programming (SDP) method to improve the accuracy and to reduce the required time for wireless sensor network localization in harsh environments. In fact, we perturb Edge-based SDP (ESDP) relaxation and add some constraints to the optimization problem in order to make the proposed localization method robust against large amounts of error in distance measurements. Simulation results confirm that our proposed method outperforms others when the majority of connections are NLOS, noise level is high and it is not possible to distinguish between NLOS and line of sight (LOS) connections.