Service composition is one of the key objectives for adopting Service Oriented Architecture. Today, web services, however, are not always perfectly compatible and composition mismatches are common problems. Service mediation, generally classified into signature and protocol ones, thus becomes one key working area in SOA. While the former has received considerable attention, protocol mediation is still open and current approaches provide only partial solutions. In this paper, a pattern-based approach is proposed for developers to semi-automatically generate mediators and glue partially compatible services together. Based on the investigation on workflow patterns and message exchanging sequences in service interactions, several basic mediator patterns are developed and can be used to modularly construct advanced mediators that can resolve all possible protocol mismatches, especially such mismatches about complicated control logics. Moreover, the architecture for the service mediation sy...