Service-Oriented Architecture (SOA) is an architectural style in building Web applications based on services. In SOA, the lack of trust between different parties affects the adoption of such architecture. Because trust is an important factor in successful online interactions, it is a major criterion for service selection. In the context of online services and SOA, the literature shows that the field of trust is not mature. The definitions of trust and its essential aspects do not reflect the true nature of trust online. This paper proposes a comprehensive trust-based SOA solution based on an identified trust definition and its principles for selecting services based on their trustworthiness. In particular, SOA is extended and a new component, the trust framework, which is responsible for the trust process, is added to the architecture. Consequently, its components are identified and built. The trust-based SOA is implemented through experiments and scenarios. Ó 2016 The Authors. Production and hosting by Elsevier B.V. on behalf of King Saud University. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).