login

General Purpose

This X-Service is used by the client application in order to establish a connection with the MetaLib X-Server.
This X-Service is invoked when a valid /X user name and password is entered. The unique session-id retrieved in the response is passed to all other X-Service calls in order to authorize the calling application for other required X-Services.

Flow

login – Called once by the calling application with a valid /X user name and password. The session-id retrieved is passed to all other API calls.

Input Parameters

1. USER_NAME – X(40).
2. USER_PASSWORD – X(20).

Explanation of the parameters:
  • user_name – User name for which the X-Service is performed.
  • user_password – Password of the User_name (equal to Verification). This field is mandatory.

Input XML Format

<?xml version = "1.0" encoding = "UTF-8"?>
<x_server_request>
  <login_request>
    <user_name>name</user_name>
    <user_password>password</user_password>
  </login_request>
</x_server_request>

Input URL Syntax

In order for a user (the application or entity authorized by the X-Server) to get X-Services, the appropriate User_name and User_password attributes must be embedded within this URL syntax:

MetalibPath:port/X?op=login_request&user_name=name&user_password=***

For example:

http://ram47:8334/X?op=login_request&user_name=exlibris&user_password=12

Output XML Format

The XML output includes:
  • An indication whether or not the calling application is permitted to use X-Services (in the <auth> field).
    Valid values:

    • <auth>Y</auth> – the application is permitted to use X-Services.
    • <auth>N</auth> – the application is not permitted to use X-Services.
  • Session ID. Retains the session ID for all other API calls. If a calling application is permitted to use X-Services, logging in creates a new session
Example:
<x_server_response metalib_version="4.00 (20)">
  <login_response>
    <auth>Y</auth>
    <session_id new_session="Y">PB22QIX32KJK8AV3GCEPNU19I2HJVGQCS3XPJEG97LN66G5TID</session_id>
  </login_response>
</x_server_response>

Possible Error Codes

If one of the parameters is missing, the following error message appears in the XML output:

<error_code>2038</error_code>
<error_text>Missing element from XML request - "user_name"</error_text>