什么是web服务_什么是Web服务?-程序员宅基地

技术标签: python  java  linux  http  php  

什么是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服务的最大优点是它与平台无关。

Introduction to Web Services

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/

Introduction

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

什么是web服务

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/cunfen6312/article/details/107684232

智能推荐

使用UmcFramework和unimrcpclient.xml连接多个SIP设置的配置指南及C代码示例

在多媒体通信领域,MRCP(Media Resource Control Protocol)协议被广泛用于控制语音识别和合成等媒体资源。UniMRCP是一个开源的MRCP实现,提供了客户端和服务端的库。UmcFramework是一个基于UniMRCP客户端库的示例应用程序框架,它帮助开发者快速集成和测试MRCP客户端功能。本文将详细介绍如何使用UmcFramework和unimrcpclient.xml配置文件连接到多个SIP设置,以及如何用C代码进行示例说明。

java.net.ProtocolException: Server redirected too many times (20)-程序员宅基地

文章浏览阅读3k次。报错:java.net.ProtocolException: Server redirected too many times (20)1.没有检查到cookie,一直循环重定向。解决:CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));URL url = new URL(url); ..._java.net.protocolexception: server redirected too many times (20)

springboot启动报错 Failed to scan *****/derbyLocale_ja_JP.jar from classloader hierarchy_failed to scan from classloader hierarchy-程序员宅基地

文章浏览阅读4.1k次。问题这是部分报错信息2019-07-11 14:03:34.283 WARN [restartedMain][DirectJDKLog.java:175] - Failed to scan [file:/D:/repo/org/apache/derby/derby/10.14.2.0/derbyLocale_ja_JP.jar] from classloader hierarchyjava...._failed to scan from classloader hierarchy

MATLAB-ones函数_matlab中ones函数-程序员宅基地

文章浏览阅读2.8k次,点赞3次,收藏7次。在MATLAB中,ones函数用于创建一个指定大小的由1组成的矩阵或数组。_matlab中ones函数

解决PS等软件出现应用程序无法正常启动(0xc000007b)_photoshop应用程序无法正常启动0xc000007b。请单击“确认”关闭应用程序。-程序员宅基地

文章浏览阅读3.9w次,点赞2次,收藏9次。  在使用电脑办公过程中,安装应用程序时难免遇到无法安装或者无法正常启动的问题,这对我们使用电脑带来了诸多不便。那遇到应用程序无法正常启动的问题要如何解决呢?相信大家肯定都是十分疑问的,每次都是只能忍痛重新安装软件。今天,小编就和大家探讨下应用程序无法正常启动的解决方法,帮助大家排忧解难。0xc000007b电脑图解1  第一种方案:SFC检查系统完整性来尝试修复丢失文件  1、打开电脑搜索输入cmd.exe,选择以管理员身份运行,跳出提示框时选择继续。0xc000007b电脑图解2_photoshop应用程序无法正常启动0xc000007b。请单击“确认”关闭应用程序。

oracle介质恢复和实例恢复的异同-程序员宅基地

文章浏览阅读396次。1、概念 REDO LOG是Oracle为确保已经提交的事务不会丢失而建立的一个机制。实际上REDO LOG的存在是为两种场景准备的:实例恢复(INSTANCE RECOVERY);介质恢复(MEDIA RECOVERY)。 实例恢复的目的是在数据库发生故障时,确保BUFFER CACHE中的数据不会丢失,不会造成数据库的..._oracle 实例恢复和介质恢复

随便推点

轻松搭建CAS 5.x系列(5)-增加密码找回和密码修改功能-程序员宅基地

文章浏览阅读418次。概述说明CAS内置了密码找回和密码修改的功能; 密码找回功能是,系统会吧密码重置的连接通过邮件或短信方式发送给用户,用户点击链接后就可以重置密码,cas还支持预留密码重置的问题,只有回答对了,才可以重置密码;系统可配置密码重置后,是否自动登录; 密码修改功能是,用户登录后输入新密码即可完成密码修改。安装步骤`1. 首先,搭建好cas sso server您需要按..._修改cas默认用户密码

springcloud(七) feign + Hystrix 整合 、-程序员宅基地

文章浏览阅读141次。之前几章演示的熔断,降级 都是 RestTemplate + Ribbon 和RestTemplate + Hystrix ,但是在实际开发并不是这样,实际开发中都是 Feign 远程接口调用。Feign + Hystrix 演示:  eruka(略)order 服务工程:  pom.xml<?xml version="1.0" encoding="U..._this is order 服务工程

YOLOv7如何提高目标检测的速度和精度,基于优化算法提高目标检测速度-程序员宅基地

文章浏览阅读3.4k次,点赞35次,收藏43次。学习率是影响目标检测精度和速度的重要因素之一。合适的学习率调度策略可以加速模型的收敛和提高模型的精度。在YOLOv7算法中,可以使用基于余弦函数的学习率调度策略(Cosine Annealing Learning Rate Schedule)来调整学习率。

linux中进程退出函数:exit()和_exit()的区别_linux结束进程可以用哪些函数,它们之间有何区别?-程序员宅基地

文章浏览阅读4k次,点赞4次,收藏9次。 linux中进程退出函数:exit()和_exit()的区别(1)_exit()执行后立即返回给内核,而exit()要先执行一些清除操作,然后将控制权交给内核。(2)调用_exit函数时,其会关闭进程所有的文件描述符,清理内存以及其他一些内核清理函数,但不会刷新流(stdin, stdout, stderr ...). exit函数是在_exit..._linux结束进程可以用哪些函数,它们之间有何区别?

sqlserver55555_sqlserver把小数点后面多余的0去掉-程序员宅基地

文章浏览阅读134次。select 5000/10000.0 --想变成0.5select 5500/10000.0 --想变成0.55select 5550/10000.0 --想变成0.555select 5555/10000.0 --想变成0.5555其结果分别为:0.5000000 0.5500000 0.5550000 0.5555000一、如果想去掉数字5后面多余的0 ,需要转化一下:selec..._sql server 去小数 0

Angular6 和 RXJS6 的一些改动_angular6,requestoptions改成了什么-程序员宅基地

文章浏览阅读3.1k次。例一:import { Injectable } from '@angular/core';import { Observable } from 'rxjs';import { User } from "./model/User";import { map } from 'rxjs/operators';import { Http, Response, Headers, RequestOp..._angular6,requestoptions改成了什么

推荐文章

热门文章

相关标签