rest - Jasper webservice: Invalid resource descriptor -
i try upload simple image via rest
webservice jasper server.
this http request/response, i'm getting "400 bad request: invalid resource descriptor". tried copy valid resource descriptor repository , re-upload gives same error!
(the dots represent \r\n
, \t
chars.)
t 10.84.6.166:36057 -> 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 -> 10.84.6.166:36057 [ap] http/1.1 100 continue. . t 10.84.6.166:36057 -> 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. . <resourcedescriptor name="s2" wstype="img" uristring="/reports/customers/3221/s2.png" isnew="true">. .<label><![cdata[serverattacks_13-06-01.png]]></label>. .<creationdate>1373470272965</creationdate>. .<resourceproperty name="prop_resource_type">. ..<value><![cdata[com.jaspersoft.jasperserver.api.metadata.common.domain.fileresource]]></value>. .</resourceproperty>. .<resourceproperty name="prop_parent_folder">. ..<value><![cdata[/reports/customers/3221]]></value>. .</resourceproperty>. .<resourceproperty name="prop_version">. ..<value><![cdata[0]]></value>. .</resourceproperty>. .<resourceproperty name="prop_has_data">. ..<value><![cdata[true]]></value>. .</resourceproperty>. .<resourceproperty name="prop_is_reference">. ..<value><![cdata[false]]></value>. .</resourceproperty>. </resourcedescriptor>. --72e01e9922f8bb1669638258c2a2a155. content-disposition: form-data; name="/reports/customers/3221/s2.png". content-length: 22544. content-type: application/octet-stream. content-transfer-encoding: binary. . <long binary png contents> --72e01e9922f8bb1669638258c2a2a155--. t 10.84.6.166:8080 -> 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
update:
i still don't know what's wrong got working , released jasper php library on github: http://blog.flowl.info/2013/jasper-php-library-on-github/
i tried update jrxml on jasperserver. found , buld java tests. found working example of updating image on jasperserver.mаy уou.(with of example wrote request updating jrxml on jasperserver. , works!)
post http://repsuite.cheby.ru:8080/jasperserver/rest/resource/sample_rest_folder/junit_image_file http/1.1 content-length: 5560 content-type: multipart/form-data; boundary=dzfspjmyjb0pl6bhxkgtqi4vmakgl9ptwcrlejv host: repsuite.cheby.ru:8080 connection: keep-alive user-agent: apache-httpclient/4.1.1 (java 1.5) cookie: jsessionid=e485652b97c69549403d8ceea0dc0855 cookie2: $version=1 --dzfspjmyjb0pl6bhxkgtqi4vmakgl9ptwcrlejv content-disposition: form-data; name="resourcedescriptor" <resourcedescriptor name="junit_image_file" wstype="img" uristring="/sample_rest_folder/junit_image_file" isnew="true"> <label>jaspersoft logo</label> <description>jaspersoft logo</description> <creationdate>1308696383000</creationdate> <resourceproperty name="prop_resource_type"> <value>com.jaspersoft.jasperserver.api.metadata.common.domain.fileresource</value> </resourceproperty> <resourceproperty name="prop_parent_folder"> <value>/sample_rest_folder</value> </resourceproperty> <resourceproperty name="prop_version"> <value>0</value> </resourceproperty> <resourceproperty name="prop_is_reference"> <value>false</value> </resourceproperty> <resourceproperty name="prop_has_data"> <value>true</value> </resourceproperty> </resourcedescriptor> --dzfspjmyjb0pl6bhxkgtqi4vmakgl9ptwcrlejv content-disposition: form-data; name="/sample_rest_folder/junit_image_file"; filename="jaspersoftlogo_2.jpg" content-type: application/octet-stream
----binary content of image----
Comments
Post a Comment