This paper presents some intermediate results of the EU-IST project WASP that aims to develop an integrated model for implementing applications using wireless sensor networks. In this paper we present our approach to programming sensor networks. The main contribution concerns the separation of three abstraction levels leaving more room for standardization than with current practices. In addition, we propose to program the network from an overall perspective rather than programming individual nodes. For doing this we present two programming models that complement one another. The proposed programming model is event-based, corresponding closely to the nature of wireless sensors. The paper shows our approaches by giving several examples and ends with a description of wireless sensor networks related services and gives an outlook on future work.