How to repair a failed composite service with end-to-end constraints is a big concern for users. Just by replacing a failed atomic service may not solve the problem, due to constraints violation or unavailability of remote services (server crash down, network disconnect, and so on). In this paper we propose an approach for service replacement based on constraints partition in web service composition. We propose to replace a failed service and (several) related services as a whole in the composition by other alternative services. The approach is divided into three steps, namely, decomposing the global constraints, filtering the candidates and replacing the failed service. We evaluate our approach by comparing it with other approaches. The results of experiments show that our approach outperforms the others, especially when the number of candidate services is large.