General Purpose

The service updates an existing item in the required ADM library after performing all relevant initial checks prior to that action.

Interface Type


Product Version Compatibility

Version 20

Input Parameters

1. XML_FULL_REQ – X (20000).
2. LIBRARY – X (5).

Xml_Full_Req: This is the input xml representing the new item. It is detailed in the example. This is a mandatory parameter.
Library: This is a mandatory parameter to determine the Administrative library of the item to be updated.


  • It is possible to update the Item’s barcode. Updating can be configured to work with the barcode checksum mechanism. For example when no barcode is sent in the input XML, it can be created by the checksum mechanism. If a barcode is sent, it can be corrected and validated using this mechanism.
  • If a barcode is changed for a temporary item that arrived as a result of an ILL borrowing request, the relevant ILL borrowing request record (Z411) is updated with this new item’s barcode.
  • It is impossible to change doc_number or item_sequence.
  • All validation checks and corrections are done similar to creating an item via the Cataloging module.
    If the sub-library or item-status are updated and the item used to or is about to be an advance booking item, the relevant records are deleted or updated with the new data (Z320/Z321).
  • The X-Service expects an input XML containing the Item’s record with the updated fields. The doc_number and item_sequence MUST be included in that XML because this information is used to update the item. There are two options for structure of the input XML as follows:
    • Full Item record (Z30) is sent via XML with all values within it.
    • A partial Item record is sent via XML.

The key to the table (doc & item sequence) must be included and only the fields to be updated are included in the XML. Fields not to be changed are NOT included in the XML. All fields not included in the XML remain the same.

  • Permission – Each X-Service has its own permission. This enables the Aleph permission mechanism to vary between different X-Services relative to who is allowed to activate an X-Service and which X-Service. The permission is built from the Func / Sub-Func. The permission for Update-Item X-Service is for WWW-X / UPD-ITEM.

Output XML Format

The output XML includes the following information:

  • The item’s record (Z30).
  • The Success / Failure message for updating a new item.
  • A reason is supplied in case of a failure.

Update-Item X-Service Activation

Activation is done using the HTTP protocol with POST method. The Create-Item requires an XML input file and as such, it cannot be activated using a regular GET method (simple URL). The application creating the POST request must contain the following mandatory parameters:

1. op=update-item.
2. library=ADM library of the Item to be updated.
3. xml_full_req=The xml containing the updated values item.

Aside from these three mandatory parameters, there is a list of non-mandatory parameters that can be sent to any Aleph X-Service and to Read-Item X-Service as well.

1. con_lng=Default is ENG (English)
2. translate=Default is ‘Y,’ meaning use the Aleph translate mechanism.
3. session_id=Each Aleph X-Service retrieves session_id in its output XML. It contains the user’s details and can be used to continue using other X-Services with this user.
4. user_name=The staff user activating the X-Service. The permission granted to activate the X-Service is checked for this staff user. The default is ‘WWW-X.’
5. user_password=The password for the staff user activating the X-Service. The permission granted to activate the X-Service is checked for this staff user. The default is ‘WWW-X.’

Example for activating Update-Item X-Service using a Perl application:
Assume the input XML representing the Item to be updated is as follows:


The file can look like the following:

<?xml version="1.0" encoding="UTF-8" ?>
        <z30-call-no>Heb 2106.385.5</z30-call-no>
        <z30-call-no-key>7 selected</z30-call-no-key>
        <z30-call-no-2-type />
        <z30-call-no-2 />
        <z30-call-no-2-key />
        <z30-note-opac />
        <z30-note-circulation />
        <z30-note-internal />
        <z30-order-number />
        <z30-inventory-number />
        <z30-inventory-number-date />
        <z30-price />
        <z30-shelf-report-number />
        <z30-vendor-code />
        <z30-invoice-number />
        <z30-pages />
        <z30-issue-date />
        <z30-expected-arrival-date />
        <z30-arrival-date />
        <z30-item-statistic />
        <z30-enumeration-a />
        <z30-enumeration-b />
        <z30-enumeration-c />
        <z30-enumeration-d />
        <z30-enumeration-e />
        <z30-enumeration-f />
        <z30-enumeration-g />
        <z30-enumeration-h />
        <z30-chronological-i />
        <z30-chronological-j />
        <z30-chronological-k />
        <z30-chronological-l />
        <z30-chronological-m />
        <z30-supp-index-o />
        <z30-85x-type />
        <z30-depository-id />
        <z30-gap-indicator />

An example for a Perl application (for programmers) called ‘update_item.pl:’

use strict;
require LWP::UserAgent;
$| = 1; # unbuffered output 

my $ua = LWP::UserAgent->new; 
my $data; 

my $in_file = shift or die "input XML file needed\n"; 
open( IN_F, $in_file) or die "Cannot open file as input\n" ; 
while (<IN_F>) { $data.=$_; }

my $url= 'http://localhost:'.$ENV{'HTTPD_PORT'}.'/X'; 

my %form; 
$form{'xml_full_req'}  =  $data; 
$form{'op'}            = 'update_item' ; 
$form{'library'}       = 'usm50' ; 

my $res = $ua->post("$url",\%form); 
if ($res->is_success) { 
  print ($res->content); 
  printf "\n--------------------\nfetched %d bytes\n", length($res->content); 
} else { 
  print "\nError: " . $res->code . " " . $res->message; 

To activate Update-Item X-Service with this Perl application on the input file, use the following:

perl update_item.pl item_to_update.xml

The Update-Item X-Service is activated in order to update item in the USM50 library.

Update-Item X-Service reply example:

If this processed successfully, the output XML contains all the relevant information.

<?xml version = "1.0" encoding = "UTF-8"?>
<z30-sub-library>Main Library</z30-sub-library>
<z30-item-status>At bindery</z30-item-status>
<z30-call-no>Heb 2106.385.5</z30-call-no>
<z30-call-no-key>7 heb 2106.385.5</z30-call-no-key>
<error>Item has been updated successfully</error>

Possible Error Codes

1. If no item exists based on the given doc_number and item_sequence in the input XML, the following message is displayed in the output XML:

< error>no item exist based on given doc number and item sequence</error>

2. All regular validity checks and error messages as they appear in the error table h_error_eng/check_z30 might occur and display in the output xml.

< error>Input ADM document doesn’t exist. Item cannot be created</error>

3. If for some reason the item could not be updated, the following message is displayed in the output xml:

< error>Failed to update the item </error>

4. If the input library is not an ADM library, the following message is displayed in the output xml:

< error>Input library must be an Administrative library </error>

5. If an xml was not provided, the following message is displayed in the output xml:

< error>xml must be provided to update Item </error>

6. If the item used to be an advance booking item and its sub-library or item status was changed in a way that requires a change in the advance booking item’s data but that item has advance booking requests, the following message is displayed:

< error> Item has Short-term requests. Item Information can’t be updated</error>