Software composition is critical for building large-scale applications. In this paper, we consider the composition of components that are methods offered by heterogeneous, autonomous and distributed computational software modules made available by external sources. The objective is to compose these methods and build new applications while preserving the autonomy of the software modules. This would decrease the time and cost needed for producing and maintaining the added functionality. In the following, we describe a highlevel protocol that enables software composition. CPAM, CHAIMS Protocol for Autonomous Megamodules, may be used on top of various distribution systems. It offers additional features for supporting module heterogeneity and preserving module autonomy, and also implements several optimization concepts such as cost estimation of methods and partial extraction of results.