Please use the Apache issue tracking system for new NetBeans issues ( !!

Bug 159073

Summary: Unable to Test RESTful Web Services with PUT method and Query encoded params
Product: webservices Reporter: dtrounine <dtrounine>
Component: RESTAssignee: Denis Anisimov <ads>
Status: RESOLVED FIXED QA Contact: issues <>
Priority: P3    
Version: 6.x   
Target Milestone: TBD   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Report:

Description dtrounine 2009-02-24 16:12:16 UTC
JAX_RS Web Service contains the following method:

public Users updateUser(
            @QueryParam("skey")     String skey) {...}

This corresponds to the following WADL:

<method name="PUT" id="updateUser">
    <param type="xs:string" style="query" name="skey"/>
    <representation mediaType="application/xml"/>

So, the parameter skey should be encoded in URL.
However, if "Test RESTful Web Service" feature is used on that project, and an attempt is made to send PUT request with
skey parameter, the test doesn't encode the skey parameter in URL. (PUT method is selected from "Choose method to test"
list, skey value is entered in a text filed and "Test" button is pressed). Used browser: Forefox 3.0.6.

Below is the log from HTTP monitor of that test:

Request: PUT http://localhost:8080/myapp/user?

Status: 200 (OK)

Time-Stamp: Tue, 24 Feb 2009 16:06:09 GMT

Insert content here.


<?xml version="1.0" encoding="UTF-8"?>
   <users xmlns="">
       <fail>Invalid session key : null</fail>


So, one can see from this log that the query string doesn't contain encoded skey parameter.
Similar problem with POST method. Testing GET method works fine, all parameters are encoded.
Comment 1 Denis Anisimov 2010-09-22 14:14:14 UTC
First of all I can't reproduce fail in response as shown in the description.
The problem exists nevertheless . 
But it is not in value encoding. 
Each parameter value is encoded via "escape()" method in javascript when
HTTP request is generated.

For POST and PUT methods there is "Content" textarea which is intended for
content of HTTP request. It always has some value ( me be empty string ""
but it is still not null  value). In this case other parameters ( in the 
described example "skey" parameter ) are ignored . Only "Content" value is 
used for HTTP request.

To fix this behavior one need to add dedicated parameters with values to the
resulting content of POST/PUT request.
Comment 2 Denis Anisimov 2010-09-23 07:37:28 UTC
changeset:   177967:2981c69b8750
user:        Denis Anisimov <>
date:        Thu Sep 23 11:26:31 2010 +0400
summary:     Fix for BZ#159073 -  Unable to Test RESTful Web Services with PUT method and Query encoded params
Comment 3 Quality Engineering 2010-09-25 02:54:53 UTC
Integrated into 'main-golden', will be available in build *201009250000* on (upload may still be in progress)
User: Denis Anisimov <>
Log: Fix for BZ#159073 -  Unable to Test RESTful Web Services with PUT method and Query encoded params
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo