简体   繁体   English

RESTful服务:在客户端上自动生成实体

[英]RESTful Service: Generating automatically entities on client

I'm new to REST webservices I build successfully a RESTful service and a client. 我是REST Web服务的新手,我成功构建了RESTful服务和客户端。 I wonder, that I can't find the opportunity to generate my entities automatically on the client side. 我想知道,我找不到机会在客户端自动生成我的实体。 That means I have to provide all entities to client (eg as jar lib). 这意味着我必须将所有实体提供给客户端(例如jar jar)。

Is it really the only way? 真的是唯一方法吗?

I have worked with SOAP Webservice and the entities were generated automatically on the client side. 我使用过SOAP Webservice,并且实体是在客户端自动生成的。 So I think I'm missing something. 所以我想我缺少了一些东西。

If your REST service(s) support XML, you can provide clients XSDs of your data model, which provides them a widely-supported mechanism to generate your entity classes in their environment. 如果您的REST服务支持XML,则可以为客户端提供数据模型的XSD,这将为它们提供广泛支持的机制,以在其环境中生成实体类。

WADL is nice to define REST operations but it unfortunately does not cover the entity definitions, so it would not help you much there. WADL很好地定义了REST操作,但不幸的是它不涉及实体定义,因此在这里并不能为您提供很多帮助。

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

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