Service-oriented architectures (SOAs) usually comprehend in-the-middle entities such as proxies or service mediators that compose services abstracting from the order in which they exchange messages. Although widely used, these entities are usually implemented by means of ad-hoc solutions. In this paper we generalise this composition mechanism by identifying the primitive notion of aggregation. We formally define the semantics of aggregation in terms of a process calculus. We also provide a reference implementation for this primitive by extending the Jolie language, thus allowing for the experimentation with real SOA scenarios.