来自 WADL 的 Restful 客户端

发布于 2025-01-03 01:09:15 字数 115 浏览 7 评论 0 原文

有没有什么方法可以使用 HttpUrlConnection 或第三方解决方案(例如 jersey、apache、restlet 等)从 wadl 自动生成 jax-rs 客户端?拥有一个框架/应用程序不是一个优势吗?

Is there any way generating automatically a jax-rs client with HttpUrlConnection or third party soloutions like jersey, apache, restlet etc. out of an wadl? Wouldnt it be an advantage to have a framework/application for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

内心旳酸楚 2025-01-10 01:09:15

WADL 有一个基本的客户端代码生成器,可通过 Apache CXF JAX-RS 实现 http://cxf.apache.org/docs/jaxrs-services-description.html

它生成一些样板代码,但它与 SOAP/WSDL Web 服务的客户端生成器相差甚远。

There is a rudimentary client-side code generator from WADL available with Apache CXF JAX-RS implementation http://cxf.apache.org/docs/jaxrs-services-description.html

It generates some boilerplate code, but it is nothing close to client generators for SOAP/WSDL web services.

π浅易 2025-01-10 01:09:15

我使用 wadl-maven-plugin 提供的wadl.java.net/" rel="noreferrer">wadl 站点。它使用 Jersey 客户端来完成大部分工作。它远非完美,但我已经使用它取得了一些成功。这肯定比维护我自己的客户要好。

I use the wadl2java wadl-maven-plugin provided from the wadl site. It uses the Jersey client to do most of the work. Its far from perfect, but I've been using it with some success. It sure beats maintaining my own clients.

何必那么矫情 2025-01-10 01:09:15

如果您有可用于 Rest 服务的 WADL 端点(即您已使用 Jersey 创建了 REST 项目)或 WADL 文件,那么您可以尝试 FI-WARE 项目在链接 http://www.fi-ware.eu/tools/updates/

为了下载它,您必须打开 Eclipse(我们在 Eclipse indigo 上测试过它)并进入“帮助 -> ”。安装新软件...”并单击添加按钮;在新的弹出窗口中设置名称(任何您认为有助于记住新插件的名称)和我提供的 URL (http://www.fi-ware.eu/tools/updates/)。

您将找到四个插件,但在您的情况下,您只能选择 FI-WARE REST 客户端生成器插件。

这里 https://forge.fi-ware.eu/ frs/download.php/167/REST_Client_Generator_User_Manual_0.0.1.pdf 您还可以找到用户指南。
我希望这是有用的

干杯
帕斯卡莱

If you have available for your Rest service a WADL endpoint (i.e. you have created a REST project with Jersey) or WADL file, then you can try REST client generator plugin for Eclipse provides by FI-WARE project at link http://www.fi-ware.eu/tools/updates/.

In order to download it you must open Eclipse (we tested it on Eclipse indigo) and go in 'Help -> Install New Software...' and click the Add button; in the new pop-up set the name (any name you think it's useful to remeber the new plugin) and the URL I provided (http://www.fi-ware.eu/tools/updates/).

You will find four plugins, but in your case you can select only the FI-WARE REST client generator Plugin.

Here https://forge.fi-ware.eu/frs/download.php/167/REST_Client_Generator_User_Manual_0.0.1.pdf you'll find a user guide too.
I hope this is useful

cheers
Pasquale

记忆消瘦 2025-01-10 01:09:15

JDeveloper 提供了一个选项来根据提供的 WADL URL 创建 Jersey 客户端。它生成调用操作所需的骨架代码,您只需调用此代码即可。

JDeveloper provides an option to create a Jersey client based on a provided WADL URL. It generates the skeletal code required to invoke the operations and you just need to invoke this code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文