Sensor mission assignment concerns matching the sensing resources of a wireless sensor network (WSN) to appropriate tasks (missions), which may come to the network dynamically. Although solutions for WSNs with battery-operated nodes have been proposed for this problem, no attention has been given to networks whose nodes have energy harvesting capabilities, which impose quite a different energy model. In this paper we address this problem by providing both an analytical model and a distributed heuristic, called EN-MASSE, for energy harvesting WSNs. The objective of both model and EN-MASSE is to maximize the profit of the network, fully exploiting the harvesting technologies, while ensuring the execution of the most critical missions within a given target WSN lifetime. The performance of EN-MASSE is evaluated by simulations based on real solar energy traces. Our experiments show that EN-MASSE behaves very closely to the optimum provided by our model and significantly outperforms previously proposed solutions.