Proposed and developed is a service composition framework for decision-making under uncertainty, which is applicable to stochastic optimization of supply chains. Also developed is a library of modeling components which include Scenario, Random Environment, and Stochastic Service. Service models are classes in the Java programming language extended with decision variables, assertions, and business objective constructs. The constructor of a stochastic service formulates a recourse stochastic program and finds the optimal instantiation of real values into the service initial and corrective decision variables leading to the optimal business objective. The optimization is not done by repeated simulation runs, but rather by automatic compilation of the simulation model in Java into a mathematical programming model in AMPL and solving it using an external solver.