Service-oriented wireless sensor networks constitute the most important components in smart cities, which adopt multiple information and communication technologies (ICT) to improve our life quality. Smart devices can be cooperatively composed together to create flexible resource environments with more powerful computing capabilities. Trust relationship between devices would be an important premise to guarantee an interaction can be successfully carried on. However, some malicious services may exist in connected devices, which would behave abnormal and destroy the interaction. Recently, rating decomposition has become an emerging solution to evaluate component services in the composition. However, existing approaches are unable to solve some main challenges, such as the opaque structure, the complex invocational pattern and the subjective rating. In this paper, an efficient rating decomposition approach is proposed to fairly distribute the overall subjective ratings to each component in the opaque composite service. It first models composite services as Beta-mixture models, and learns both responsibilities and reputations through expectation-maximization (EM) algorithm. Then, it computes the contribution of each component by using the Shapley value in corporative gaming theory, and improves the efficiency of Shapley value computation by bit vector-based encoding. Moreover, the fairness can be guaranteed that no component in the composition would receive extra rewards or punishments. Finally, the approach has been validated theoretically and experimentally through simulation studies. The results demonstrate the effectiveness of the proposed approach, which can fairly decompose the consumers' rating to each component hierarchically.