Restful Client from WADL

2019-01-18 21:43发布

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?

标签: rest jax-rs wadl
4条回答
Deceive 欺骗
2楼-- · 2019-01-18 21:58

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

查看更多
我只想做你的唯一
3楼-- · 2019-01-18 22:21

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.

查看更多
劫难
4楼-- · 2019-01-18 22:24

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.

查看更多
SAY GOODBYE
5楼-- · 2019-01-18 22:24

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.

查看更多
登录 后发表回答