Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response always empty #2

Open
ghuisman19 opened this issue Jul 17, 2018 · 2 comments
Open

Response always empty #2

ghuisman19 opened this issue Jul 17, 2018 · 2 comments

Comments

@ghuisman19
Copy link

I tried to get the xml using this API. Server response is NULL.
Guzzle give me this error:

[error] => The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information.
[url] => https://home.textkernel.nl/sourcebox/extract.do?useJsonErrorMsg=true&useHttpErrorCodes=true

I added sink option to the Guzzle client:
$this->client = new Client([
'base_uri' => $this->baseUri,
'sink' => 'C:\Webserver\sink.txt',
'verify' => false,
]);

In C:\Webserver\sink.txt i get a complete XML file with the extracted CV.

Is there a way to fix this problem ?

@MaximeMaillet
Copy link

MaximeMaillet commented Jul 20, 2018

Hi !
What is your real problem ?

Do you use this :

    use Eoko\TextKernel\Factory\TextKernelFactory;
    
    $account = 'change_me';
    $username = 'change_me';
    $password = '########';
    
    $factory = new TextKernelFactory();
    $api = $factory->createSourceboxApi($account, $username, $password);
    
    try {
        /** @param \Eoko\TextKernel\Model\CvModel $cv */
        $cv = $api->extractFromFile($filepath);
        // or
        $cv = $api->extract($cvBuffer);
    } catch(\Exception $e) {
        //handle errors
    }

This library is used for extract data from CV by TextKernel. With extractFromFile you receive a \Eoko\TextKernel\Model\CvModel,.

Then you can get information here : https://github.com/eoko/text-kernel/blob/master/src/Model/CvModel.php

@ghuisman19
Copy link
Author

Hi,

The real problem is "the cURL request was retried 3 times and did not succeed" when is use this:
$cv = $api->extractFromFile($filepath);

I fixed it, by not using this API, i used CURL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants