Nowadays increasing use of web as a means to accomplish daily tasks by calling web services, makes web services more and more significant. Users make a query on the Internet to find the required web service based on their needs. Cloud computing, due to its design and abundance of resources has become an ideal choice for web service providers to publish their services backed by cloud servers. The cloud can eliminate problems like web service availability and security. On the other side, obtaining the most relevant web service depends on user's request accuracy and the mechanism used to match the request. Due to recent shutting down of public UDDI registries, most of web service matchmaking mechanisms are based on web service description files (WSDL) which are published on the owners' websites. Semantic web services use OWL-S and WSMO instead of WSDL to describe services in a way that software agents are able to find appropriate services automatically. However, the high cost and effort needed to formally define web services makes this method impractical. In this paper we have proposed an ontology which formally models the user's query for web services in the service cloud by considering both functional and syntactical dimensions. The stepwise matchmaking method of web services based on the user's query is also presented. To show the precision of the proposed method, a set of experiments on a cluster of 3738 real web service WSDL documents has been performed.