What is a “web service” in plain English?

前端 未结 21 1143
半阙折子戏
半阙折子戏 2020-11-30 16:34

I\'ve been reading about \"web services\" here on SO, on Wikipedia, Google, etc., and I don\'t quite understand what they are. What is the plain English definition/descript

21条回答
  •  甜味超标
    2020-11-30 17:05

    Yes that is a simple web service.

    Web services are really nothing more than a request/ response mechanism that allows a client to remotely access/ modify data. There are formal standards for web services (SOAP, SOA etc), but your simple page is a service too.

    The main downside to printing it to a page is that your service would return HTML. Preferable data formats are JSON and XML, because most client frameworks (and server frameworks) are designed around using JSON and XML.

    So if you modified your service to return:

    some random number
    

    rather than:

    ...  
    some random number
    

    then it would be more useful to most clients

提交回复
热议问题