Posting XML in the body of a text/xml HTTP request through the proxy fails
--------------------------------------------------------------------------

                 Key: WOOKIE-148
                 URL: https://issues.apache.org/jira/browse/WOOKIE-148
             Project: Wookie
          Issue Type: Bug
          Components: Server
         Environment: Working on the trunk (rev.956738) on Windows XP
            Reporter: Sander van der Waal


When I post an XML document through the proxy the content is truncated by the 
ProxyClient which results in an empty body in the HTTP request from the proxy 
to the URL I want to post to.

Specifically, in JavaScript I construct something similar to this [1]:

  var xml_data = "<xml>some xml</xml>";
  var xml_request = new XMLHttpRequest();
  var loc = 'http://localhost:8080/simal-rest/addProject';
  loc = Widget.proxify(loc);

  xml_request.open("POST", loc, true);
  xml_request.setRequestHeader("Cache-Control", "no-cache");
  xml_request.setRequestHeader("Content-Type", "text/xml");
  xml_request.send(xml_data);

Everything's fine until the post mehod in ProxyClient, which does (lines 
96-100): 

(96)  PostMethod method = new PostMethod(uri);
(97)  method.setDoAuthentication(true);
(98)  method.setRequestEntity(new StringRequestEntity(xmlData, "text/xml", 
"UTF8"));
(99)  method.addParameters(this.parameters); 
(100)  return executeMethod(method, properties);

After (98) the requestEntity is set in the PostMethod, but directly after (99) 
it's back to null again, and as a result the HTTP request that is sent contains 
an empty body.

[1] 
https://simal.googlecode.com/svn/trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js
 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to