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?
相关问题
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- Laravel 5.1 MethodNotAllowedHttpException on store
- Can I parameterize labels and properties on CREATE
相关文章
- Cannot use org.jvnet.jax-ws-commons.jaxws-maven-pl
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
- Global Exception Handling in Jersey & Spring?
- REST search interface and the idempotency of GET
- Getting error detail from WCF REST
- Send a GET request with a body in JavaScript (XMLH
- GuzzleHttp Hangs When Using Localhost
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
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.
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.
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.