Hi Stuart,

>> The problem lies on line 98:
>>  
>> curl_setopt($sac_curl, CURLOPT_READDATA, fopen($sac_fname, 'rb'));
>>  
>> "CURLOPT_READDATA" appears to be part of libcurl, but not implemented in 
>> (current versions?) of PHP (it's not listed in the documentation for 
>> curl_setopt - http://uk2.php.net/manual/en/function.curl-setopt.php ).

>How have you tracked the issue down to that line?  Is it that line that throws 
>an error, if so, what is the error?

Sorry, I was jumping to conclusions, based on assuming the documentation was 
complete. I've looked through the error log, and found that it's actually a 
simpleXML error being thrown, so the problem is most likely with the server 
returning something other than XML:

"error-library.log:[Tue Jul 19 16:09:40 2011] [error] [client 193.61.230.90] 
PHP Fatal error:  Uncaught exception 'Exception' with message 'Error parsing 
response entry (String could not be parsed as XML)' in 
/www/library/digitalarchive/swordapp-php-library-1.0/swordappclient.php:120..."

Line 120 is in a "catch" block, so the error is somewhere in the try block 
above:

            $sac_xml = @new SimpleXMLElement($sac_resp);
               $sac_ns = $sac_xml->getNamespaces(true);

            // Build the deposit response object
            $sac_dresponse->buildhierarchy($sac_xml, $sac_ns);

I haven't really had time to investigate much further, today and yesterday, but 
next week I'll do some further looking testing with the code from the deposit 
function.

>SWORD v1 does not support any type of multipart deposit.  For a typical 
>package deposit, where the package is a zip file, the Content-Type needs to be 
>'application/zip'.

Thanks.

>>    $dep_packaging = "http://www.loc.gov/METS/";;

>What does ArchivalWare expect as the way your package is described?  DSpace, 
>EPrints, and Fedora expect packages made using the PHP PackagerMetsSwap.php 
>packager to be described using the header 'X-Packaging: 
>http://purl.org/net/sword-types/METSDSpaceSIP'.

The examples I was sent by the developers, used "X-Packaging: 
http://www.loc.gov/METS/";, so I've being doing likewise.

> What is the curl command you are using on the command line which works?

curl -i --data-binary "@path/to/archive.zip" \
-H "Content-Disposition: filename=archive.zip" \
-H "Content-Type: application/zip" \
-H "X-Packaging: http://www.loc.gov/METS/"; \
-H "X-No-Op: false" -H "X-Verbose: true" \
http://username:passw...@repository.ac.uk/path/to/library/deposit

Thanks,
Rob



------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
sword-app-tech mailing list
sword-app-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sword-app-tech

Reply via email to