refactor some method in WebServiceTest