A novel methodology for modeling the reliability and performance of web services (WSs) is presented. To present the methodology, an experimental environment is developed in house, where WSs are treated as atomic entities but the underlying middleware is partitioned into layers. WSs are deployed in JBoss AS. Web service requests are generated to a remote middleware on which JBoss runs, and important performance parameters under various configurations are collected. In addition, a modularized simulation model in Petri net is developed from the architecture of the middleware and run-time behavior of the WSs. The results show that (1) the simulation model provides for measuring the performance and reliability of WSs under different loads and conditions that may be of great interest to WS designers and the professionals involved; (2) configuration parameters have substantial impact on the overall performance; (3) the simulation model provides a basis for aggregating the modules (layers), nullifying modules, or to include additional aspects of the WS architecture; and (4) the model is beneficial to predict the performance of WSs for those cases that are difficult to replicate in a field study.