A web service is application that provides a standard means of interoperating between different software applications, running on a variety of platforms and/or frameworks - typically using HTTP or HTTPS as a transport layer for object and request models (SOAP, REST, JSON, etc). The output isn't intended to be directly shown in browser.
A web service is an application that provides services to consumers (web applications, thick clients, other services, mobile apps, etc.). Those services may provide data, perform some calculation or just about anything other than providing a UI. Thus, it will have a clearly-defined API which consists of providing responses to requests made by a remote application.
Don't confuse with web-application. Web application does have GUI intended to be shown in web browser.