Zombse

The Zombie Stack Exchanges That Just Won't Die

View the Project on GitHub anjackson/zombse

Using the Aleph update-doc X-Service

In Aleph v20, I want to use the update-doc X-Service. I have a script set up to do this:

  1. HTTP GET xml from /X?op=find-doc&base=BASE&doc_num=XXXXXXXXX
  2. edit the xml
  3. HTTP POST the edited xml back to /X?op=update-doc&base=BASE&doc_num=XXXXXXXXX&doc_action=UPDATE&user_name=USER&user_password=PASS&xml_full_req=EDITED_XML

Aleph always responds with:

<update-doc>
<session-id>SOME SESSION ID</session-id>
</update-doc>

i.e., no error messages, but no success message, either. It does the same thing when I send an invalid doc_action parameter. Is UPDATE an invalid doc_action parameter?

Has anyone made the update-doc service work?

PS I don't control (or know much about) the Aleph server configuration.

EDIT: The x-service user did not have sufficient privileges in the Aleph cataloging module. Once that was fixed by our Aleph server admin, the steps above worked properly (find-doc, edit the response, POST the edited response back to update-doc)

Brad

Comments

Answer by kardeiz

The X-Server for DigiTool--which seems to be very similar to Aleph's--requires that a session ID string be provided for some queries ("The session-id must be included in every subsequent query string...").

Have you tried logging in with the X-Server "login" operation (something like http://HOST/X?op=login&USER_NAME=Name&USER_PASSWORD=Password), collecting the returned session-id, and including it as a parameter with your HTTP post (e.g., ...&SESSION_ID=whatever)?

Alternatively, perhaps there is a problem with your XML--are you sending the XML document as a URL parameter? If so, is it properly encoded?

Also, note that you can view some documentation for the X-Server at http://HOST/X?op=explain.

Comments

Answer by user869

I just read somewhere that this behaviour could also occur when you do not have sufficient rights.

Comments