Hello,

Two days ago my customer contacted me about this message when he tries Add new Biblio Content using DOI import:

"HTTP error: 400 when trying to contact crossref.org for XML input"

He was using version 7.x-1.0-rc5 . I updated to 7.x-1.0-rc7 and the problem continues. Does anybody knows the why of this message ?

Comments

kevinsullivan’s picture

I debugged the problem.

In the Biblio file, ...site/all/modules/biblio/modules/crossref/biblio.crossref.client.php, in the function called fetch, you have to make the following change:

FROM: $request_options = array('method' => 'POST');
TO: $request_options = array('method' => 'GET');

It should have been GET in the first place, I suppose; but it seems that POST had been working, as well.

The problem is that the crossref.org server is now throwing a Java exception when you present it with a POST request at this URL, thus producing the 400 server error.

Kevin Sullivan

wescleyteixeira’s picture

Hi kevinsullivan,

It worked, now the website is working fine!
Thanks for explain about the changes in crossref.org too.

Best Regard!!

rjerome’s picture

I've committed that change. Thanks Kevin for tracking it down.

rjerome’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

schillij’s picture

I made the change suggested by kevinsullivan in #1 and still get the same error message.

"HTTP error: 400 when trying to contact crossref.org for XML input"

Any other suggestions to correct this issue?

Jeff

Jujubre’s picture

I got the same issue, #1 solved it.
The queried url can be retrieved for testing in you browser by adding a line in fetch():

  public function fetch() {
    $this->query = $this->url . '?pid=' . $this->pid . '&noredirect=true&format=unixref&id=doi%3A' . $this->doi;
    drupal_set_message($this->query); // add this line for url output
gchalker@princeton.edu’s picture

Kudos to KevinSullivan! Worked like a charm.

Alan D.’s picture

Slightly clearer fix, for a cleaner easier read code base. Albeit I am not reopening for this simple style fix.

From

    $request_options = array('method' => 'POST');
    $result = drupal_http_request($this->query, $request_options);

To

    $result = drupal_http_request($this->query);

Reference: http://cgit.drupalcode.org/biblio/commit/?id=fd8ee42

Mark F’s picture

Still getting this issue on rc7 and -dev (todays date - tried both). Made all of the changes above in both. Still got same error. Using ' 10.1056/NEJMoa1402454' as the DOI.

bib_boy’s picture

#1 worked for me...POST -> GET

thanks!