简体   繁体   English

Web服务的最重要用途

[英]Most important uses of web service

Web services are used to share the services provided by an application, to outside world. Web服务用于将应用程序提供的服务共享给外界。 This is my basic understanding of web services. 这是我对Web服务的基本理解。

Suppose my application is to expose some specific behaviors and I have written the code for it and exposed the methods. 假设我的应用程序要公开一些特定的行为,并且我已经为其编写了代码并公开了方法。 The ones who want to use it can take the link to the wsdl, generate stub and call the methods. 想要使用它的人可以链接到wsdl,生成存根并调用方法。

What is the use of doing all this, when I can myself expose the methods, generate a jar and bundle everything in it and share the server address,jar. 当我自己可以公开这些方法,生成一个jar并将其中的所有内容捆绑在一起并共享服务器地址jar时,这样做有什么用。

How differently is web services important, when compared to a case explained above. 与上述情况相比,Web服务的重要性有何不同。 Am asking such a general question due to unsuccessful search in many websites. 由于在许多网站中搜索失败,所以我问这样一个普遍的问题。

If you'd generate a client jar, whoever wants to use that would have to deal with Java. 如果要生成一个客户端jar,则任何想使用它的人都必须处理Java。 If you expose a Web Service instead, the user can use whatever technology he/she wants to use (eg Python, Ruby, .net, C, C++ etc. etc.). 如果改为公开Web服务,则用户可以使用他/她想使用的任何技术(例如Python,Ruby,.net,C,C ++等)。 That would be a huge advantage. 那将是一个巨大的优势。

What you are suggesting is quite close to RESTful webservices. 您的建议与RESTful Web服务非常接近。 Unlike SOAP webservices, RESTful webservices do not require any WSDL files. 与SOAP Web服务不同,RESTful Web服务不需要任何WSDL文件。 All that you need to do is to issue a request to a particular URL. 您需要做的就是向特定URL发出请求。

As you explained correctly (in my opinion) SOAP webservices involve some more work which needs to be done, thus making them more complex, if you will, to integrate with other systems. 正如您正确解释的那样(我认为),SOAP Web服务还需要做更多的工作,因此,如果愿意的话,使其与其他系统集成也变得更加复杂。 This is not the case with RESTful webservices. RESTful Web服务不是这种情况。

EDIT: You can check out a tutorial here . 编辑:您可以在此处查看教程。 I have tried it myself a while back and it is enough to get you started. 我已经尝试过一段时间了,这足以让您入门。

Web服务使用一系列标准(SOAP,WSDL ...)使不同类型的系统协同工作,当然您可以根据需要生成客户端jar,但这需要您的服务使用者学习如何使用它,因此不是通用的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 感知器学习——最重要的特征 - Perceptron learning - most important feature Web服务(服务器-客户端)。 服务器使用外部项目 - Web Service (Server - Client). Server uses external project 从使用列表的.Net调用Java Web Service <T> - Calling Java Web Service from .Net that uses List<T> Android上Java代码中最重要的优化是什么? - What are the most important optimizations in Java code on Android? 是否可以在网络堆栈中添加或替换语言? (重要) - Is it possible to add or replace a language in a web stack? (Important) 如何将图像从App Inventor发送到使用FormDataParam的Java Web服务 - How to send image from App Inventor to a java web service that uses FormDataParam 如何使使用Web服务作为数据源的子报表在Jasper Reports中工作 - How to make a subreport that uses web service as the data source work in Jasper Reports .NET将使用的用于Apache Tomcat JSP平台的最具互操作性的Web服务平台 - Most interoperable web service platform for Apache Tomcat JSP platform to be consumed by .NET 针对 Android API 3 (OS 1.5) 而不是最新的 API,我会错过哪些最重要的功能? - Which are the most important features I will miss targeting Android API 3 (OS 1.5) instead of most recent API? 使用尤里卡和功能区的测试服务 - Test service that uses eureka and ribbon
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM