什么是web服务

Web Services are client and server applications that communicate over the World Wide Web's (WWW) Hypertext Transfer Protocol (HTTP). As described by the World Wide Web Consortium (W3C), web services provide a standard means of interoperating between software applications running on a variety of platforms and frameworks.

Web服务是通过万维网( WWW )超文本传输​​协议( HTTP )进行通信的客户端和服务器应用程序。 如万维网联盟(W3C)所述,Web服务提供了在各种平台和框架上运行的软件应用程序之间进行互操作的标准方法。

Web Services can be looked as a code on demand. Just like we call functions and methods, web services can be looked upon as calling a function or method over the internet using some sort of protocols and some agreements.

Web服务可以看作是按需代码 。 就像我们调用函数和方法一样,Web服务可以看作是使用某种协议和某些协议通过Internet调用函数或方法。

A web service is a function or method which we can call by sending an HTTP request to a URL, with arguments and the service returns the result back as response.

Web服务是一种函数或方法,可以通过将HTTP请求发送到带有参数的URL来调用该函数或方法,然后该服务将结果作为响应返回。

The biggest advantage of the web services is that it is platform independent.

Web服务的最大优点是它与平台无关。

Consider the above figure, We can see that the application written in Java can interact with PHP and .net platforms through the web service. Therefore, it is completely platform independent. A web service exposed in the PHP can be consumed by any platform be it java, .net or PHP. This capability of the web service is making it so popular. Therefore, a web service is a language independent way of communication.

考虑上图,我们可以看到用Java编写的应用程序可以通过Web服务与PHP和.net平台进行交互。 因此,它是完全独立于平台的。 PHP公开的Web服务可以被任何平台使用,无论是Java,.net还是PHP。 Web服务的这种功能使其变得如此流行。 因此,Web服务是一种独立于语言的通信方式。

Now let us look at one of the most common use case where web services are being used extensively.

现在,让我们看一下广泛使用Web服务的最常见用例之一。

Consider the figure below, suppose I have made a new cool application but I do not want to maintain the data of the users, who login to my application, but we want only authenticated users to use the application.

考虑下图,假设我已经制作了一个很酷的应用程序,但是我不想维护登录到我的应用程序的用户的数据,但是我们只希望经过身份验证的用户才能使用该应用程序。

So what should we do? One option is, we can use the web services exposed by some other third party application, to authenticate our incoming users. You must have seen this in many applications, in form of - Sign up using Facebook, Google or other third party apps. Many Websites/Apps use Facebook and Google data, using their web services, to authenticate users.

那我们该怎么办? 一种选择是,我们可以使用某些其他第三方应用程序公开的Web服务来验证传入的用户。 你必须在许多应用中已经看到了这一点,在形式- 注册使用Facebook, 谷歌或其他第三方应用。 许多网站/应用程序通过其Web服务使用Facebook和Google数据来验证用户身份。

Therefore, we do not have to maintain any data of the users to authenticate, rather we can now fully concentrate on the content of our application.

因此,我们不必维护用户的任何数据即可进行身份验证,而现在我们可以完全专注于应用程序的内容。

The flow of the authentication process will be like this:

身份验证过程的流程将如下所示:

  1. User logs into our Application.

    用户登录到我们的应用程序。

  2. We show them two options - either sign in using Facebook or Google.

    我们向他们展示了两个选项-使用Facebook或Google登录。

  3. Enter the Username and Password.

    输入用户名和密码。

  4. The application will now pass the Username and Password to Google or Facebook server using http request.

    该应用程序现在将使用http请求将用户名和密码传递给Google或Facebook服务器。

  5. The request/response can be in any format. It could be a json/xml or any other media type.

    请求/响应可以是任何格式。 它可以是json / xml或任何其他媒体类型。

  6. Now if the request is ok, Google or Facebook server will send us the response and accordingly we will authenticate our users to login into the application.

    现在,如果请求正常,Google或Facebook服务器将向我们发送响应,并相应地我们将对用户进行身份验证以登录到该应用程序。

The third party apps, who expose their APIs must provide a proper documentation of all the requests and responses. Checkout this link for the PayPal API to get some idea how documentation is done - https://developer.paypal.com/docs/api/identity/

公开其API的第三方应用程序必须提供所有请求和响应的正确文档。 查看此PayPal API链接以了解如何完成文档制作-https: //developer.paypal.com/docs/api/identity/

翻译自: https://www.studytonight.com/rest-web-service/introduction

什么是web服务

什么是web服务_什么是Web服务?相关推荐

  1. 如何搭建java web环境_搭建java WEB开发环境和应用

    搭建java WEB开发环境和应用 更新时间:2009年06月07日 02:28:56   作者: 使用Tomcat服务器,使用DBCP数据源搭建Web开发环境 一 使用Tomcat服务器,使用DBC ...

  2. app开发和web开发_理解现代Web App开发概念的指南

    app开发和web开发 Millions of businesses exchange information on the internet and to interact with their t ...

  3. 前后端分离和微服务_为什么说微服务,要从前后端分离开始?一文带你揭秘深入微服务...

    前言 既要低头赶路,又要抬头望天,科技是为人服务的,任何技术背后都有更深层次的考量. 之前的文章中咱们聊了很多微服务的相关内容,简而言之,微服务的本质,就是一种可以加速分工.促进合作的新协作机制.知其 ...

  4. palapaweb怎样开启服务_为什么说微服务,要从前后端分离开始?一文带你揭秘深入微服务...

    前言 既要低头赶路,又要抬头望天,科技是为人服务的,任何技术背后都有更深层次的考量. 之前的文章中咱们聊了很多微服务的相关内容,简而言之,微服务的本质,就是一种可以加速分工.促进合作的新协作机制.知其 ...

  5. sim卡没坏但苹果手机无服务_苹果xs无服务没信号,XS基带坏了维修多少钱

    iOS系统的每次发布,有许多小伙伴都会熬夜等更新,因为系统更新后的好处就不用多说了,既能修复之前系统BUG故障问题,又带来了全新的操作体验.不过,也有网友表示更新后一天内n次无服务,手机连不上wifi ...

  6. oracle 监听程序当前无法识别连接描述符中请求的服务_最新版Web服务器项目详解 04 http连接处理(上)...

    点 击 关 注 上 方"两猿社" 设 为"置 顶 或 星 标",干 货 第 一 时 间 送 达. 互 联 网 猿 | 两 猿 社 本文内容 在服务器项目中,http请求的处理与响应至关重要,关系到用户 ...

  7. centos7 如何重启web服务_如何重启web服务器

    {"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],&q ...

  8. java web 教案_《Java web程序设计》教案.pdf

    课题:第一章 Java Web 概述 [教学目标] 掌握 JSP 运行环境的搭建,能进行简单的 JSP 程序编写与运行. [教学重点] Eclipse+Dreamweaver 工具.项目的导入.导出. ...

  9. java web源代码_检测Java Web应用程序而无需修改其源代码

    java web源代码 与其他系统进行交互时,大多数Java Web应用程序都使用标准Java接口. 诸如Web页面或REST服务器之类的基于HTTP的服务是使用接口javax.servlet.Ser ...

最新文章

  1. nvm 装 nodejs 重启终端失效的解决方法
  2. python基础知识8——常见内置模块
  3. 【数据结构与算法】之深入解析“省份数量”的求解思路与算法示例
  4. 用VisualStudio2010学习WCF服务编程总结(1)操作重载
  5. iOS截取特定的字符串(正则匹配)
  6. 数据库设计(四)概念数据模型
  7. 人工蜂群算法python_教程 | 用人工蜂群算法求解k-分区聚类问题
  8. [凯立德]2013.12.17凯立德发布秋季版(2F21J0E)最新增量包SP1
  9. 适合财务人员的财务报表分析软件有哪些?
  10. 爬取企业信息-企业信用信息查询系统-天眼查爬虫
  11. Github Page 个人主页——自定义域名
  12. 信能阳光——打造国内体育照明领域的旗舰品牌
  13. 关于 X509Certificate2 找到文件路径的问题
  14. 支付宝面试:说说序列和反序列?
  15. HTML 教程:基础标签
  16. 三角形边长求高的c语言函数公式,c 求,已知三角形三边边长为abc,利用公式求面积...
  17. 最全元宇宙概念分析!元宇宙为何发展于区块链?
  18. C语言教程-main函数
  19. Python爬虫实践2,企业工商信息查询
  20. 红石外汇|每日汇评:澳元空头等待突破上升趋势线- 100日SMA线下方

热门文章

  1. codeforces 750D New Year and Fireworks【DFS】
  2. conda创建使用虚拟环境
  3. Unity UGUI 效果 之 UI 元素 多边形UI (例如雷达图,圆形,不规则多边形 UI等)显示 的简单实现的几种方法整理
  4. 自动备份MySQL数据库并发送邮件的SHELL脚本
  5. 51单片机(c语言基础)
  6. huffman图像编码C语言,Huffman编码 数据结构 C语言
  7. 解决电脑出现 R6034 Runtime Error
  8. 八大排序,你都掌握了吗?
  9. Hash的Md5算法
  10. 编译linux系统到开发板,Linux系统有关交叉编译和移植到6410开发板上的简单过程...