In this paper, we propose a novel approach for composing existing web services to satisfy the correctness constraints to the design, including freeness of deadlock and unspecified reception, and temporal constraints in Computation Tree Logic formula. An automated synthesis algorithm based on learning algorithm is introduced, which guarantees that the composite service is the most general way of coordinating services so that the correctness is ensured. We have implemented a prototype system evaluating the effectiveness and efficiency of our synthesis approach through an experimental study. Categories and Subject Descriptors H.3.5 [Information Storage and Retrieval]: On-line Information Services--Web-based services General Terms Algorithm, Design Keywords composition synthesis, correctness constraints, learning algorithm.