porozco Posted September 19, 2013 Share Posted September 19, 2013 Hi Everybody! According to Samples from: http://community.jaspersoft.com/wiki/php-client-sample-code Yesterday I felt a little bit curious about testing Jasper Client, so I started using following code: <?php require_once "rest/client/JasperClient.php"; $client = new JasperJasperClient('report.myserver.com', 80, 'myuser', 'mypassword', '/jasperserver-pro', 'organization_1'); $repository = $client->getRepository(); var_dump($repository); ?> But the Apache Error Log is yelling me with an error like this one: [Thu Sep 19 10:14:29 2013] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Jasper\RESTRequestException' with message 'Unexpected HTTP code returned: 401 Body of response: Apache Tomcat/7.0.40 - Error report HTTP Status 401 - Full authentication is required to access this resourcetype Status reportmessage Full authentication is required to access this resourcedescription This request requires HTTP authentication.Apache Tomcat/7.0.40' in /var/www/jasperreports/htdocs/rest/client/JasperClient.php:133nStack trace:n#0 /var/www/jasperreports/htdocs/rest/client/JasperClient.php(587): Jasper\JasperClient->prepAndSend('http://report.s...', Array, 'GET', NULL, true)n#1 /var/www/jasperreports/htdocs/info.php(13): Jasper\JasperClient->getRepository()n#2 {main}n thrown in /var/www/jasperreports/htdocs/rest/client/JasperClient.php on line 133 I just double checked host, username, password and org and everything seems right. Do I am missing something here? Thanks in advance. Link to comment Share on other sites More sharing options...
llucas_gs Posted November 27, 2013 Share Posted November 27, 2013 Hello!I'm trying to do something like this:<?PHPini_set('display_errors',1);ini_set('display_startup_errors',1);error_reporting(E_ALL);require_once "vendor/autoload.php";use JaspersoftClientClient;$c = new Client( "localhost", "8082", "jasperadmin", "jasperadmin", "/jasperserver", "organization_1" );$info = $c->serverInfo();print_r($info);?>[/code]i have a similar error:Fatal error: Uncaught exception 'JaspersoftExceptionRESTRequestException' with message 'Unexpected HTTP code returned: 401 Body of response: Apache Tomcat/7.0.42 - Error report HTTP Status 401 - Bad credentialstype Status reportmessage Bad credentialsdescription This request requires HTTP authentication.Apache Tomcat/7.0.42' in /home/lucas/projects/integracao/vendor/jaspersoft/rest-client/src/Jaspersoft/Tool/RESTRequest.php:431 Stack trace: #0 /home/lucas/projects/integracao/vendor/jaspersoft/rest-client/src/Jaspersoft/Service/JobService.php(86): JaspersoftToolRESTRequest->prepAndSend('http://localhos...', Array, 'GET', NULL, true, 'application/job...', 'application/job...') #1 /home/lucas/projects/integracao/index.php(20): JaspersoftServiceJobService->getJob('/reports/listae...') #2 {main} thrown in /home/lucas/projects/integracao/vendor/jaspersoft/rest-client/src/Jaspersoft/Tool/RESTRequest.php on line 431Anyone know how to fix it? Link to comment Share on other sites More sharing options...
ahesanbvm Posted March 29, 2016 Share Posted March 29, 2016 I am also facing the same issue for this PHP client. Any solution please Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now