2013-07-15 114 views
1

我不知道如何解決這個問題。這是我的要求,我改變了這樣的格式內容長度是不正確的此示例中:PUT reportUnit通過REST失敗 - Tomcat錯誤

PUT /jasperserver/rest/resource/reports/Customers/3221/Wasser1 HTTP/1.1 
Host: 10.84.6.166:8080 
Accept: */* 
Cookie: JSESSIONID=D170F2EA5110E4ADA55515C8F1B4D68F 
X-HTTP-Method-Override: PUT 
Content-Length: 1697 

<resourcedescriptor isnew="true" name="Wasser1" uristring="/reports/Customers/3221/Wasser1" wstype="reportUnit"> 
<label> 
<!--[CDATA[test_report(test.jrxml)]]--> 
</label> 
<description> 
<!--[CDATA[Wasser1 generated by Jasper.php through REST Mon, 15 Jul 2013 09:57:56 +0200]]--> 
</description> 
<resourceproperty name="PROP_PARENT_FOLDER"> 
<value> 
<!--[CDATA[/reports/Customers/3221]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_HAS_DATA"> 
<value> 
<!--[CDATA[false]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_IS_REFERENCE"> 
<value> 
<!--[CDATA[false]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_RESOURCE_TYPE"> 
<value> 
<!--[CDATA[com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_RU_ALWAYS_PROPMT_CONTROLS"> 
<value> 
<!--[CDATA[false]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_RU_CONTROLS_LAYOUT"> 
<value> 
<!--[CDATA[1]]--> 
</value> 
</resourceproperty> 
<resourcedescriptor isnew="false" name="test02" uristring="/reports/Customers/3221/test02" wstype="jrxml"> 
<label> 
<!--[CDATA[test02 Report]]--> 
</label> 
<description> 
<resourceproperty name="PROP_PARENT_FOLDER"> 
<value> 
<!--[CDATA[/reports/Customers/3221]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_HAS_DATA"> 
<value> 
<!--[CDATA[true]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_IS_REFERENCE"> 
<value> 
<!--[CDATA[false]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_RESOURCE_TYPE"> 
<value> 
<!--[CDATA[com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource]]--> 
</value> 
</resourceproperty> 
<resourceproperty name="PROP_SECURITY_PERMISSION_MASK"> 
<value> 
<!--[CDATA[31]]--> 
</value> 
</resourceproperty> 
</description> 
</resourcedescriptor> 
</resourcedescriptor> 

響應:

HTTP/1.1 400 Bad Request. 

The request sent by the client was syntactically incorrect(). 

任何想法?

+0

爲什麼你對請求有X-HTTP-Method-Override? –

+0

我讀過最好在所有REST/PUT請求中爲兼容性原因添加該行。 – DanFromGermany

+0

你不應該相信你所讀到的:-) –

回答

1

我發現孩子ResourceDescriptors對自己的引用,

,所以我不得不補充:

PROP_RU_IS_REFERENCE = true 
PROP_RU_REFERENCE_URI = uriString 

爲它工作!