OAI-PMH data provider validation fails for one single POST request, despite it's working with curl

137 Views Asked by At

I'm implementing an OAI-PMH2 compliant data provider in PHP (which retrieves data from a MySQL database), and I'm trying to get it validated, but am stuck with just one error that prevents successful validation.

The error is somewhat related to what is described in this question, however in my case the POST request with verb=Identify passes successfully, while the second one fails.

More annoyingly, the same request is processed successfully when I send it with curl, i.e. it outputs a properly formed XML.

To be more specific, the error I get is the following:

REQUEST http://www.mydataprovider/my_oaipmh2.php POST 
identifier:oai:www.mydataprovider/my_oaipmh2.php:1 
metadataPrefix:oai_dc verb:GetRecord
FAIL POST test 2 for GetRecord was unsuccessful, got neither a valid response nor an error

(www.mydataprovider/my_oaipmh2.php stands for the acual URL, of course.)

So I've tried performing (several times) the same POST request via curl, like this:

curl --data "verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:www.mydataprovider/my_oaipmh2.php:1" http://www.mydataprovider/my_oaipmh2.php

and it always successfully returns a proper XML response with the first record.

What am I missing? Could this be due to some server-side settings?
(I don't have access to server management myself, but I could ask the hosting provider, of course.)

1

There are 1 best solutions below

0
On

I've found the problem. The XML resulting from the request wasn't properly formed, since it had a ListRecords root element, rather than the appropriate GetRecord, i.e. it should have been:

<GetRecord>
  <record>
   <header>
   ...
   </header>
  </record>
</GetRecord>