title: Jasper webservice: Invalid resource descriptor
body: <p>I try to upload a simple image via <code>REST</code> webservice to the jasper server.</p>
  
  <p>This is the HTTP request/response, I'm getting <em>"400 Bad Request: Invalid resource descriptor"</em>.
  I tried to copy a valid resource descriptor from the repository and re-upload it but it gives the same error!</p>
  
  <p><em>(The dots represent <code>\r\n</code> and <code>\t</code> chars.)</em></p>
  
  <pre><code>T 10.84.6.166:36057 -&gt; 10.84.6.166:8080 [AP].
  PUT /jasperserver/rest/resource/reports/Customers/3221/image01.gif HTTP/1.1.
  User-Agent: useragent.
  Host: 10.84.6.166:8080.
  Accept: */*.
  Cookie: JSESSIONID=5D8D24835E61ED65ABD982964243C06B.
  Content-Type: multipart/form-data; boundary="72e01e9922f8bb1669638258c2a2a155".
  Content-Length: 23796.
  Expect: 100-continue.
  .
  
  
  T 10.84.6.166:8080 -&gt; 10.84.6.166:36057 [AP]
  HTTP/1.1 100 Continue.
  .
  
  
  T 10.84.6.166:36057 -&gt; 10.84.6.166:8080 [AP]
  --72e01e9922f8bb1669638258c2a2a155.
  Content-Disposition: form-data; name="ResourceDescriptor".
  Content-Length: 811.
  Content-Type: text/plain; charset=UTF-8.
  Content-Transfer-Encoding: 8bit.
  .
  &lt;resourceDescriptor name="s2" wsType="img" uriString="/reports/Customers/3221/s2.png" isNew="true"&gt;.
  .&lt;label&gt;&lt;![CDATA[serverattacks_13-06-01.png]]&gt;&lt;/label&gt;.
  .&lt;creationDate&gt;1373470272965&lt;/creationDate&gt;.
  .&lt;resourceProperty name="PROP_RESOURCE_TYPE"&gt;.
  ..&lt;value&gt;&lt;![CDATA[com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource]]&gt;&lt;/value&gt;.
  .&lt;/resourceProperty&gt;.
  .&lt;resourceProperty name="PROP_PARENT_FOLDER"&gt;.
  ..&lt;value&gt;&lt;![CDATA[/reports/Customers/3221]]&gt;&lt;/value&gt;.
  .&lt;/resourceProperty&gt;.
  .&lt;resourceProperty name="PROP_VERSION"&gt;.
  ..&lt;value&gt;&lt;![CDATA[0]]&gt;&lt;/value&gt;.
  .&lt;/resourceProperty&gt;.
  .&lt;resourceProperty name="PROP_HAS_DATA"&gt;.
  ..&lt;value&gt;&lt;![CDATA[true]]&gt;&lt;/value&gt;.
  .&lt;/resourceProperty&gt;.
  .&lt;resourceProperty name="PROP_IS_REFERENCE"&gt;.
  ..&lt;value&gt;&lt;![CDATA[false]]&gt;&lt;/value&gt;.
  .&lt;/resourceProperty&gt;.
  &lt;/resourceDescriptor&gt;.
  --72e01e9922f8bb1669638258c2a2a155.
  Content-Disposition: form-data; name="/reports/Customers/3221/s2.png".
  Content-Length: 22544.
  Content-Type: application/octet-stream.
  Content-Transfer-Encoding: binary.
  .
  &lt;long binary png contents&gt;
  --72e01e9922f8bb1669638258c2a2a155--.
  
  
  T 10.84.6.166:8080 -&gt; 10.84.6.166:36057 [AP]
  HTTP/1.1 400 Bad Request.
  Server: Apache-Coyote/1.1.
  Pragma: No-cache.
  Cache-Control: no-cache.
  Expires: Thu, 01 Jan 1970 01:00:00 CET.
  P3P: CP="ALL".
  Content-Type: text/xml;charset=UTF-8.
  Content-Length: 27.
  Date: Thu, 11 Jul 2013 08:42:09 GMT.
  Connection: close.
  .
  Invalid resource descriptor
  </code></pre>
  
  <hr>
  
  <h2><strong>Update:</strong></h2>
  
  <p><strong>I still don't know what's wrong but I finally got it working and released a Jasper PHP Library on github: <a href="http://blog.flowl.info/2013/jasper-php-library-on-github/" rel="nofollow">http://blog.flowl.info/2013/jasper-php-library-on-github/</a></strong></p>