我必須爲Jasper報告編寫一個PHP前端。我可以成功連接到服務器,使用jasper REST調用來認證和查看存儲庫。然而,當我試圖訪問一個報告,我得到以下錯誤的響應正文:jasper Rest客戶端 - 在會話中找不到uuid
報告未找到(UUID不是在會議中找到)
,PHP代碼如下:
$uri = "http://localhost:8080/jasperserver/rest/report/samples/Client_Information_Report?RUN_OUTPUT_FORMAT=html";
//PUT request to run the report
$response = Httpful\Request::put($uri, $payload)
->authenticateWith("jasperadmin", "jasperadmin")
->send();
$xml = new SimpleXMLElement($response->body);
$uuid = (String)$xml->uuid; //The uuid is successfully returned
$uri = "http://localhost:8080/jasperserver/rest/report/$uuid?file=report";
$report = Httpful\Request::get($uri)
->authenticateWith("jasperadmin", "jasperadmin")
->send();
我能夠確認一個uuid與第一個PUT一起返回。有什麼我在這裏失蹤?任何幫助表示讚賞。
我最終使用rest_v2方法在一個步驟中請求報告。我也認爲這與會議有關。謝謝你的鏈接。我會通過它。 – janenz00 2013-02-23 03:25:52
rest_v2方法的外觀如何? – zygimantus 2016-10-04 08:35:33