Consider a web service with different quality of service levels where users may purchase their required web service through a reservation system. The service provider adjusts prices of web service classes over a prespecified time horizon to manage demand and maximize profit. Users may cancel their services as long as they pay a penalty. One of the important challenges for service providers is capacity limitation of the resources employed in offering the web service. Thus, taking this important proposition into account makes pricing strategies considered by the provider has more credit. Another important factor in determining pricing strategies discussed in the present paper is the market influence which can increase or decrease the price that the provider offers. This paper develops a continuous time optimal control model for identifying pricing strategies for the web service classes. We study the optimality condition of the considered model based on maximum principal and propose an algorithm to obtain the optimal pricing policy. Moreover, we perform numerical analyses to evaluate the effect of some parameters on control and state variables and objective function. In addition, we compare the proposed algorithm with genetic algorithm (GA) and simulated annealing (SA) available in Matlab.