Error 404 in Extraction endpoint

86 views
Skip to first unread message

Cristiano Rodrigues

unread,
Jul 25, 2016, 9:50:30 AM7/25/16
to Europass Interoperability
Hello,

I am actually developing a curl request in PHP to return the XML of a PDF CV Europass.
But so far, I always get the same error: The requested URL was not found on this server

I send you my code so that you can analyze it.
index.php

Europass Interoperability

unread,
Jul 26, 2016, 11:42:34 AM7/26/16
to Europass Interoperability
Hi Cristiano,

Apologies for the late reply.

There was a temporary problem with the Europass REST API yesterday and today in the morning. Can you please try again and let us know if it works for you now?

Thank you,

Dimitris Zavaliadis
Team Europass

Cristiano Rodrigues

unread,
Jul 26, 2016, 12:19:15 PM7/26/16
to Europass Interoperability
Hello Dimitry,

I tested rigth now and the error has changed: "ErrCode:epas-b-apps-1__f3lZDtFVcontent.type.not.allowedThe media type is not allowed"
I am trying to test this webservice with your example in http://interop.europass.cedefop.europa.eu/web-services/rest-api-reference/#xml-extraction but with no success.
Did you saw my project?

Thank You for your reply
cv-in.pdf

SIAPERAS, Athanassios

unread,
Jul 27, 2016, 11:05:16 AM7/27/16
to Cristiano Rodrigues, Europass Interoperability, europass-interop

Hello Cristiano

We’ll look into it and get back to you as soon as possible, at latest by tomorrow end-of-business.

Kind regards

Thanos Siaperas

Cedefop - IT

--
You received this message because you are subscribed to the Google Groups "Europass Interoperability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to europass-inter...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Europass Interoperability

unread,
Jul 28, 2016, 8:43:44 AM7/28/16
to Europass Interoperability
Hello Cristiano,
After testing the extraction rest api you try to use in your form, we've found the following:
  • Rest api http://interop.europass.cedefop.europa.eu/web-services/rest-api-reference/#xml-extraction end point works as it was expected and you can test it by executing the curl command that it is shown there as an example.
  • After debugging the end-point behaviour on submitting your form, we found that the uploaded file's content type is "application/octet-stream" which means unknown. This is maybe due to the fact that you pass a file with a filename that is "something.tmp" and not "cv-in.pdf". Check this thing in your code and test it again.
We'll be at your disposal for further questions.

Cristiano Rodrigues

unread,
Jul 28, 2016, 10:05:27 AM7/28/16
to Europass Interoperability
Hello,

I tested rigth now with your suggestion but with no success.
I will send to you, the form with new changes.

The curl itself has a content-type header "application/pdf" and also the file i'm trying to upload.
The change i made, was to put the real name of the file, and not the temporary name.


segunda-feira, 25 de Julho de 2016 às 14:50:30 UTC+1, Cristiano Rodrigues escreveu:
index.php

Europass Interoperability

unread,
Jul 29, 2016, 10:43:06 AM7/29/16
to Europass Interoperability
Hi Cristiano,
I'm not familiar with php but I think there is a syntax error in the form you sent to us (i.e. missing  $ from fileReal in curl_file_create). Anyway, the problem is that after submitting your form, rest api receives an inputstream from which we get an unknown mime type. The error has nothing to do with the content-type header which is correct but with the inputstream your form creates. For example, on europass cv editor form, in the attachments section, there is a similar form for uploading pdf files. The code for retrieving mime type from inputstream is the same with the one the rest api uses and it works ok as you can see.
The difference between this and your form is that you actually upload a .tmp file and not a .pdf (even in your latest form) and this is not about the filename but about the physical file that it's uploaded.

Cristiano Rodrigues

unread,
Aug 1, 2016, 4:49:36 AM8/1/16
to Europass Interoperability
Hello,

I found the answer. I create a webservice to test what i send to your webservice.
When I use the curl_file_create function, the curl sends the contents of the file and a few properties of the file.
The solution is to sends only the contents of the file, using the function file_get_contents to sends the data.
So, in this way, in PHP, the solution is to use: curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents($_FILES['file']['tmp_name'])); for example, instead of using curl_file_create.
Reply all
Reply to author
Forward
0 new messages