This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269709 - Generated restful client contains error for DELETE operation
Summary: Generated restful client contains error for DELETE operation
Status: NEW
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-01 13:58 UTC by ad
Modified: 2017-02-01 13:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
WADL file for one of the delete operations in the API of a rest web service (1.48 KB, application/octet-stream)
2017-02-01 13:58 UTC, ad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ad 2017-02-01 13:58:05 UTC
Created attachment 163536 [details]
WADL file for one of the delete operations in the API of a rest web service

I add a web service using a local WADL file then use 'new RESTful Java Client' to create a client in a project. The resulting code fails for the DELETE operation (with all delete operations in the API).

I attach a WADL file with one example

The generated delete method has the following code (which also has an unexpected casing of a parameter name):

public <T> T delete(Class<T> responseType, String oUCU, String password) throws ClientErrorException
   {
      String[] queryParamNames = new String[]{"OUCU", "password"};
      String[] queryParamValues = new String[]{oUCU, password};
      ;
      javax.ws.rs.core.Form form = getQueryOrFormParams(queryParamNames, queryParamValues);
      javax.ws.rs.core.MultivaluedMap<String, String> map = form.asMap();
      for (java.util.Map.Entry<String, java.util.List<String>> entry : map.entrySet())
      {
         java.util.List<String> list = entry.getValue();
         String[] values = list.toArray(new String[list.size()]);
         webTarget = webTarget.queryParam(entry.getKey(), (Object[]) values);
      }
      return webTarget.request().delete((ERROR), responseType);
   }