Error with REST PHP Client

0

Hello,
I try to run a jasper report from a php script but it does not work.
This is what I am doing :

<?php
require_once "/opt/jrs-rest-php-client-2.0.0/vendor/autoload.php";

$c = new Client(
    "<my IP>",
    "8080",
    "<my login>",
    "<my password>",
    "jasperserver"
    );

$info = $c->serverInfo();
print_r($info);    

?>


This is the error message I have :

Fatal error: Uncaught Jaspersoft\Exception\RESTRequestException: An unexpected HTTP status code was returned by the server in /opt/jrs-rest-php-client-2.0.0/src/Jaspersoft/Tool/RESTRequest.php:364 Stack trace: #0 /opt/jrs-rest-php-client-2.0.0/src/Jaspersoft/Tool/RESTRequest.php(451): Jaspersoft\Tool\RESTRequest->handleError(404, Array, '<!DOCTYPE HTML ...') #1 /opt/jrs-rest-php-client-2.0.0/src/Jaspersoft/Client/Client.php(158): Jaspersoft\Tool\RESTRequest->prepAndSend('192.168.56.1/re...', Array, 'GET', NULL, true, 'application/jso...', 'application/jso...') #2 /opt/jrs-rest-php-client-2.0.0/tests2/test.php(43): Jaspersoft\Client\Client->serverInfo() #3 {main} thrown in /opt/jrs-rest-php-client-2.0.0/src/Jaspersoft/Tool/RESTRequest.php on line 364

Any help or suggestion will be welcomed.
Thanks
 

sterlingman2001's picture
Joined: Jun 16 2017 - 5:25am
Last seen: 1 year 3 months ago

I have also tried :
$c = new Client("http://localhost:8080/jasperserver","<my login>","<my password>", "");

and :
$c = new Client("http://localhost:8080/jasperserver","<my login>","<my password>");

but nothing works

sterlingman2001 - 1 year 8 months ago

 

HELLO, COULD YOU FIND A SOLUTION?

PHP7.0

JASPERSERVER 7.0

PHP CLIENT 2.0

polexito2002_1 - 10 months 3 days ago

0 Answers:

No answers yet
Feedback
randomness