Jasper Report -- Resource not found - php

I am developing a jasper report in PHP
I have tried embedded jasper library 0.9d -- PhpJasperLibrary-master
After fixing part of the code in the library,
It works normally but it cannot display table format which is very important for me to develop Jasper report so I give up in this method and build up an jasper server.
I have installed the PHP Client(v2.0) by composer and using the sample code in the following link
http://community.jaspersoft.com/wiki/php-client-sample-code
http://community.jaspersoft.com/project/php-client/releases
I am not sure why there is a lot of bugs in the sample code like getjob(s) function and passing variable to class client.
Anyway, I fixed it and the server info can be called.
In the last stage, I cannot run the report and the error message shown that the resource of my report not found.
Jaspersoft\Exception\RESTRequestException
Resource /20150604 not found.
I could like you to help me and I hope I can release a prefect version after all parts done.Thanks
And the below is my report information.
I have put my report under the folder /reports
and it can run in the jasper server
I have checked the URL that calling the report is like below
localhost:9090/jasperserver/rest_v2/reports/20150604.html
I have concern about the URL but I cant find any reference to it.
So please support me to fix the problem.
Thanks
additional: here is the code I call the report
$report = $c->reportService()->runReport('/20150604', 'html');

Hmm the rest endpoint to "run" a report is js/rest_v2/?path to report?.html
Unless your report is in the root of your organization, then you need a path.
Check out this (line 20):
https://github.com/jasonhuber/Jaspersoft_InputControlsFromCSV/blob/master/index.html#L20
and check in the web services guide page 71...

Related

Problem with configuration of LiveQuery in Parseplatform

Hello i have installed Parse server and parse sdk for php on my Linux Centos Server.
Parse Dashboard: 1.3.3,
Server version: 4.3.0
I'm managing those db's using php code. This parser was installed by someone else. The thing is I'm not sure how to install LiveQuery for my server. I don't know if my version of server is good for this kind of operations. I found some solutions how to enable this feature, but there was something like "index.js" - in my file system it's app.js. Screen of file system
In app.js i added lines:
liveQuery: {
classNames: ["Test"] //List of classes to support for query subscritions
}
I've created class in my db named "Test", then i found solution i need to add
this line
liveQueryUrl: keyLiveQueryUrl, // Required if using LiveQuery
I don't really know how to get this key.
How can i check if LiveQuery works? It will be used by flutter code, but i'd like to check it first in PHP.
My problem has been solved in my other extended topic here.

PHP code working locally but not on Azure

I've implemented a mail delivery service using SparkPost for a website. The code looks like this:
require '/vendor/autoload.php';
use SparkPost\SparkPost; use GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
$httpAdapter = new Guzzle6HttpAdapter(new Client());
$sparky = new SparkPost($httpAdapter, ['key'=>'...']);
[...]
[...]
$results = $sparky->transmission->send($mailarray);
It works just fine locally on WampServer, however when I deploy it to Azure it does not. I don't have access to Azure logs, but I managed to narrow down the problem to one line:
$sparky = new SparkPost($httpAdapter, ['key'=>'...']);
I simply get a 500 error without any other explanation. The weird thing is when I wrap it around a try/catch, I still don't get anything other than a blank screen and a 500 on the console. I suspect it has to do something with /autoload.php not being able to load something.
Any thoughts?
According the requirement of SparkPost lib on Github repo at https://github.com/SparkPost/php-sparkpost/blob/master/composer.json#L18, it need PHP version higher than 5.5. So you can modify the PHP version of your Azure Web Apps, please refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-version for detail steps.

PHP + create invoice into QuickBooks use API

Please help me, I'm integrating QuickBook API into our script and I get the message below when i run file: http://domain.com/build_20130416/dev/dev_ids_invoices.php
Fatal error: Call to undefined method QuickBooks_IPP::application()
I'm using php script.
Please take the time to read the documentation and look at the example files in the docs/example_app_ipp_v3/ directory for the code you downloaded. Also, make sure you follow the quick-start guide. And next time, post your code.
If you look in the same dev/ directory for the code you're using, you'll see a file named:
DO_NOT_USE_THESE_FILES.txt
With the contents:
DO NOT USE THE EXAMPLES IN THIS FOLDER!
THESE ARE ALL DEVELOPMENT/TEST SCRIPTS, AND ARE NOT PRODUCTION READY!
You should not be using the example script you're trying to use just like the file says.
It's a development testing script, and not an example that you should be using.
Instead, you should look at the code in the docs directory, which has tons of working examples. Here's a link for you to the examples on GitHub:
https://github.com/consolibyte/quickbooks-php/tree/master/docs/example_app_ipp_v3
Specifically, here's some related to invoices:
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_add.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_query.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_w_lines_query.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_with_custom_fields_add.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoices_for_customer_query.php

"No tests executed" I cannot run any PHP test in NetBeans at all

I am very new to NetBeans and I just wanted to run a Code Coverage teston my code developed earlier. I do not know what I am doing wrong.
I am using NetBeans 7.3.1 with Wamp Server 2.4, installed PHPUnit and Skeleton Generator through PEAR, and set those files in NetBeans settings.
I made the project using an existing sources. Running in my browser seems OK. I can even debug with XDebug.
But when I right click on the project name and "Test", it says "No tests executed.(0.0 s)" in the Test Result window, and this in the Output window:
PHPUnit 3.7.23 by Sebastian Bergmann.
Configuration read from C:\wamp\www\test\configuration.xml
Time: 141 ms, Memory: 2.00Mb
No tests executed!
Generating code coverage report in Clover XML format ... done
I tried running test on a PHP file, it returns an information dialog box "Test file for the selected source file was not found."
I right clicked on the PHP file, and selected "Tools->Create PHPUnit tests", it returns a warning dialog box "Tests were not generated for the following files: (file name) Review the log in Output Window." but nothing was changed in the Output window.
I generated PHPUnit Bootstrap and XML Configuration, but they did not help.
I wished I can provide screenshots, but I cannot. I am trying to be specific as possible.
I appreciate any help.
I got this error too.. I also got this in the Output tab
Fatal error: Class 'package\path\Tests\TestCase' not found in project\path\package\path\Tests\ClientTest.php on line 25
Here, TestCase is the subclass of PHPUnit_Framework_TestCase and that, along with the current test file is in a different directory structure than the source files. So, in my case, it was a path issue.
Something I noted is I need to add a bootstrap file to include files in the test path and the source path to the runtime.
This bootstrap could be generated by NetBeans. See instructions here: https://netbeans.org/kb/docs/php/phpunit.html#project-specific-configurations
I of course, had another bootstrap.php (added by another developer). I only had to link the bootstrap like follows,
Good luck!
PHPUnits message:
No tests executed!
just means that no tests were found. This can have multiple reasons:
First of all, if there are no tests, no tests are executed.
But it is also possible that there are tests, but the configuration says to skip those (for example some tests are grouped into a group named slow and the configuration XML says to exclude slow from being run).
For your case this most certainly is a configuration issue. I'm not fluent with Netbeans but as you can successfully execute PHPUnit already, that part of your setup looks working.
Next step is to find out when you invoke the test-runner where it looks for tests. It might just be that the tests directory is missing or not specified. E.g. check which configuration is in configuration.xml for example and compare that with the documentation to double-check all settings.
This is not a very concrete answer and somebody who is more fluent with Netbeans might help more, however as you'er not showing further screenshots, this is my honest best bet how to go on with trouble-shooting and why.
Seems I am getting closer to the solution. I found out the problem is not in the configurations, but in the code itself.
I do not know if this is a silly problem, but seems the test only accepts PHP codes written in OOP. I tried making another file with a class and I can make test file out of it with no problem. At least I can see the test result changes from "No test executed" to "No test passed, 1 test skipped"
My codes are written for months without OOP and I know nothing about it at all. Does this mean I have to rewrite all of them again?
It will happen when you put an assertion in a constructor of your test class and this assertion fails.
Then you will see only the warning 'No tests executed!' (not very helpful) but i suppose one should not put assertions in the constructors (this is in phpunit 4.1~).
for it was because my test names were not starting with 'test'

Soap error when trying to use the API of Magento

I am looking for help with this problem and I hope someone give me that help. The error is the following:
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://example.com/index.php/api/?wsdl' : failed to load external entity "http://example.com/index.php/api/?wsdl" in
/var/www/presentacion/app/code/local/Pengo/Extension/Model/Something.php on line 28
And the code that I'm using to connect to it is something like this:
$this->_soap = new SoapClient(http://example.com/index.php/api/?wsdl);
and there is where it says is the error.
I have been serching in Google, PHP forums, here in StackOverflow and Magento itself but I don't find the solution anywhere.
What I had seen is that the WSDL is never get parsed or loaded as the error says and none of its functions.
I tried connecting like this:
$options['location'] = http://example.com/index.php/api/?wsdl;
$options['uri'] = 'urn:Magento';
$this->_soap = new SoapClient(null, $options);
like this it doesn't dispatch any error like the others but there aren't functions to use, like in the other case it doesnt' load and parse the WSDL.
I am a bit frustrated because I have been developing this like 1 month and now that I am making some tests it shows this message, I had test it when it was really empty and new and it worked fine.
So any help would be appreciated.
Thank you.
Nine times out of ten this error is Magento is telling you it can't load the WSDL file. Magento is telling you this. It's not your local client code that's complaining.
Magento uses the PHP SoapServer object to create its SOAP API. The SoapServer object needs to access the WSDL as well. Try running the following from your server's command line
curl http://example.com/index.php/api/?wsdl
If I'm right, the above will timeout/fail.
Because of some quirks in DNS, it's surprisingly common that a server won't be able to access itself via its domain name. If this is the case, the quickest fix is adding an entry to the server's hosts file. (Talk to your server admin if none of that made sense)
Well after all the things that I test the only one that worked for me, I don't know why but it worked, was doing this in two separate machines. I tried that because I read that somewhere and I just do it and my Magento and Webservice now works perfectly. Whenever I try to do this local it dispatch the same error.
I hope this can help someone in the future and they don't have to knock their head on the wall because of this problem.
Thank you all for your answers and comments.
Alan Storm is right on the Money here!
Make sure that you check your server Hosts File, and that it includes an entry for both domain and www.domain. Espicialy important if you are doing server rewrites.

Categories