简体   繁体   English

Java REST Web服务的服务详细信息

[英]Service details in case of Java REST web services

I am new to web services in Java. 我是Java新手。

In SOAP web services, we have wsdl that tells us about the services like the operations etc. but in REST, we don't get wsdl . 在SOAP Web服务中,我们有wsdl告诉我们有关服务的操作等,但在REST中,我们没有得到wsdl

So, my question is if someone wants to know the service details, then how that can be found in case of REST web services. 所以,我的问题是,如果有人想知道服务细节,那么在REST Web服务的情况下如何找到它。

With REST there is no single established way to achieve this yet, however there are couple of options emerging: 使用REST还没有一种既定的方法可以实现这一点,但是有很多选择出现:

SOAP introduced WSDL to describe services, which can automatically be discovered and integrated with a mechanisms like UDDI. SOAP引入了WSDL来描述服务,这些服务可以自动发现并与UDDI等机制集成。 In reality SOAP is used just as hardcoded RPCs. 实际上,SOAP被用作硬编码的RPC。 If you use REST, many details like exceptionhandling, operation types, idempotency are handled using well known HTTP mechanisms. 如果使用REST,则使用众所周知的HTTP机制处理许多细节,例如异常处理,操作类型,幂等性。 The only thing you need to know is the payload encoding. 您唯一需要知道的是有效负载编码。 If you use XML, you may use XSDs to describe the services, if you use JSON you need to handle this on your own (its a lot simpler). 如果您使用XML,您可以使用XSD来描述服务,如果您使用JSON,则需要自己处理(更简单)。 The structure of your URLs should be designed so its intuitive enough, to be described in a one paged readme file. 您的网址结构应设计得足够直观,可在单页自述文件中进行描述。 To cut a long answer short: WebServices were so complicated you need a lot of boilerplating, REST services should be so simple, that a developr does not have to redefine and redocument the basics. 简而言之:Web服务非常复杂,您需要大量的电子设备,REST服务应该如此简单,开发人员不必重新定义和重新编写基础知识。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM