I'm trying to extract RDFa data from an html page using EasyRDF. But it doesn't seem to work. E.g., I've tried:
$work = new EasyRdf_Graph("http://example.com/");
$work->load();
echo $work;
$title = $work->primaryTopic();
echo "Title: ".$title->get('dc:title')."\n";
This is the error I get:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'EasyRdf_Http_Client only supports the 'http' and 'https' schemes.'
Related
Thank you in advance
I am using the PdfParser library to extract text from PDF
My current code for that is as below
$parser = new \Smalot\PdfParser\Parser();
$pdfsource = $parser->parseFile($dest_path);
$pages = $pdfsource->getPages();
foreach ($pages as $page) {
$final_text.=strtolower(str_replace(' ', '', $page->getText()));
}
It is working well but for some PDF getting below Exception
Fatal error: Uncaught Exception: Object list not found. Possible secured file. in /var/www/html/pdfparser-master/vendor/smalot/pdfparser/src/Smalot/PdfParser/Parser.php:102 Stack trace: #0
I am trying to ultimately run and display reports from a remote Jasper Server in a PHP application. What I am trying to do this with is the jrs-rest-php-client project on github.
The error:
Fatal error: Uncaught exception 'Jaspersoft\Exception\RESTRequestException' with message 'An unexpected HTTP status code was returned by the server' in C:\xampp\htdocs\jrs\vendor\src\Jaspersoft\Tool\RESTRequest.php:409
Stack trace:
#0 C:\xampp\htdocs\jrs\vendor\src\Jaspersoft\Tool\RESTRequest.php(479): Jaspersoft\Tool\RESTRequest->handleError(0, Array, false)
#1 C:\xampp\htdocs\jrs\vendor\src\Jaspersoft\Service\ReportService.php(40): Jaspersoft\Tool\RESTRequest->prepAndSend('https://jasper....', Array, 'GET', NULL, true)
#2 C:\xampp\htdocs\jrs\report.php(30): Jaspersoft\Service\ReportService->runReport('/Reports/Distri...', 'html')
#3 {main} thrown in C:\xampp\htdocs\jrs\vendor\src\Jaspersoft\Tool\RESTRequest.php on line 409
My PHP:
require_once __DIR__ . "/vendor/autoload.php";
use Jaspersoft\Client\Client;
$d = new Client(
"http://jasper.server.com/jasperserver-pro",
"username",
"password",
"organization"
);
$info = $d->serverInfo();
Any ideas?
Looking into the code of RESTRequest.php there are two cases in which this exception is thrown:
A JSON result set with an unknown error code is returned (unknown meaning different from 200 OK)
No JSON result set is returned at all
So I suspect the connection isn't working properly. To find out more, you should catch the exception in your code and evaluate it:
It could look something like this (I'm more familiar with Java):
try {
$d = new Client(
"http://jasper.server.com/jasperserver-pro",
"username",
"password",
"organization"
);
$info = $d->serverInfo();
} catch (RESTRequestException $e) {
echo 'RESTRequestException:';
echo 'Exception message: ', $e->getMessage(), "\n";
echo 'Set parameters: ', $e->parameters, "\n";
echo 'Expected status code:', $e->expectedStatusCodes, "\n";
echo 'Error code: ', $e->errorCode, "\n";
}
If there is still an error, you can check the following:
Can you reach the jasper server from the server where this code is deployed? Sometimes e.g. firewall settings can interfere.
Is the organization called exactly like defined in the properties of the organization in the server? (Open repository / right click on organization / properties / resource-id)
I'm trying to integrate cargo system to my website. Then I'm using their webservice.
But I've an error like that:
"Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find in "
And error show me that line: 2 second. And that line has that code:
$client = new SoapClient("http://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc");
And here's my full code:
<?php
$client = new SoapClient("http://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc");
$queryInfo = "<QueryInfo>".
"<QueryType>2</QueryType>".
"<Date>07.10.2015</Date>".
"</QueryInfo>";
$loginInfo = "<LoginInfo>".
"<UserName>xxx</UserName>".
"<Password>xxx</Password>".
"<CustomerCode>xxx</CustomerCode>".
"</LoginInfo>";
$result = $client->GetQueryXML(array('loginInfo'=>$loginInfo,'queryInfo'=>$queryInfo));
echo $result;
How can I solve my problem?
The url you're passing to SoapClient is not that of a wsdl file. You maybe meant to use:
$client = new SoapClient("http://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc?singleWsdl");
I have this error when parsing html
my code is like this
$html = new \simple_html_dom();
$html->load_file($url);
$type = gettype($html);
$this->output->writeln("check point1:" . $type); // it says 'object'
$class = get_class($html);
$this->output->writeln("check point2:" . $class); // it says 'simple_html_dom'
foreach($html->find('a') as $element){
//do something here.
}
then this code shows this error sometims.
PHP Fatal error: Call to a member function find() on a non-object
error
even when error happens $html is correctly fetched (I check in two check points)
This error is similar to this article though, no slution is revealed.
Please help me
I am getting the following error when trying to create a new SoapClient.
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl' : failed to load external entity "https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl" in C:\xampp\htdocs\Work\Ice\default\soaptest.php:8 Stack trace: #0 C:\xampp\htdocs\Work\Ice\default\soaptest.php(8): SoapClient->SoapClient('https://api.min...') #1 {main} thrown in C:\xampp\htdocs\Work\Ice\default\soaptest.php on line 8
what would cause the WSDL to not load?
Enable openssl in your php.ini you load the WSDL over https this is only working when the openssl module is enabled.
Not sure if this might be the case with you but if you are using the PHP classes provided on the Minbody API on Github, note that they have recently updated them. I had the same problem with classService.php. If you are using classService.php, update the constructor function to the following (same will apply to other services):
function __construct($debug = false)
{
$endpointUrl = "https://" . GetApiHostname() . "/0_5/ClassService.asmx";
$wsdlUrl = $endpointUrl . "?wsdl";
$this->debug = $debug;
$option = array();
if ($debug)
{
$option = array('trace'=>1);
}
$this->client = new soapclient($wsdlUrl, $option);
$this->client->__setLocation($endpointUrl);
}