SWORD import not working
I have tried to use SWORD V1 and V2 to deposit a SWORD package. These tests failed with different errors.
I tried to deposit to the Library Test Collection using the following commands with the following results:
SWORD V1
curl -i --data-binary "@example.zip" -H "Content-Disposition: filename=example.zip" -H "Content-Type: application/zip" -H "X-Packaging: http://purl.org/net/sword-types/METSDSpaceSIP" -H "X-No-Op: false" -H "X-Verbose: true" https://vtechworks-dev-ds7.cloud.lib.vt.edu/sword/servicedocument/10919/91907 --user "kdweeks@vt.edu"
Warning: Couldn't read data from file "example.zip", this makes an empty POST.
Enter host password for user 'kdweeks@vt.edu':
HTTP/2 415
content-language: en
content-type: application/atom+xml;charset=UTF-8
date: Thu, 16 Nov 2023 22:46:39 GMT
<sword:error xmlns:sword="http://purl.org/net/sword/" xmlns:atom="http://www.w3.org/2005/Atom" href="http://purl.org/net/sword/error/ErrorContent"><atom:summary>Unacceptable packaging type in deposit request: http://purl.org/net/sword/package/METSDSpaceSIP</atom:summary><atom:title>ERROR</atom:title><atom:updated>2023-11-16T22:46:39.550Z</atom:updated><sword:userAgent>curl/8.1.2</sword:userAgent></sword:error>
SWORD V2
curl -i --data-binary "@example.zip" -H "Content-Disposition: filename=example.zip" -H "Content-Type: application/zip" -H "X-Packaging: http://purl.org/net/sword-types/METSDSpaceSIP" -H "X-No-Op: false" -H "X-Verbose: true" https://vtechworks-dev-ds7.cloud.lib.vt.edu/sword2/deposit/10919/91907 --user "kdweeks@vt.edu"
Warning: Couldn't read data from file "example.zip", this makes an empty POST.
Enter host password for user 'kdweeks@vt.edu':
HTTP/2 404
content-language: en
content-type: text/html;charset=utf-8
date: Thu, 16 Nov 2023 22:48:32 GMT
content-length: 798
<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> The requested resource [/sword2/deposit/10919/91907] is not available</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class
I also tried using the ID number URL (https://vtechworks-dev-ds7.cloud.lib.vt.edu/collections/d32befcd-1222-4e28-9dfc-f044755d628e) instead of the handle number with the same results.
The SWORD package I'm using is example.zip from the DSpace 7 documentation and should work with SWORDv1 and SWORDv2. It can be downloaded here: https://github.com/DSpace/DSpace/tree/main/dspace-sword/example