Waramu SOAP web service

Waramu SOAP web service provides sophisticated interface for application developers to interact with Waramu repository. Detailed description of web service follows.

Response & codes

Responses are all XML documents where <status> element is always present and representing a status of requested operation. If operation fails, optional <message> element can but may not be present.

Sample responses

    <response><status>0</status>...</response>
    <response><status>1</status><message>Invalid session ID</message></response>
  • 0 - success.
  • 1 - Invalid session Id.
  • 2 - Invalid credentials.
  • 3 - Internal server error.
  • 4 - Invalid type id.
  • 5 - Invalid uid.
  • 6 - Not attachable.
  • 7 - Invalid application user information
  • 8 - Operation not allowed. Access Denied.
  • 9 - Invalid Attachment ID. Attachment does not exist.
  • 11 - Invalid Zip-file.
  • 12 - Uploaded file is not a IMS Content Package.
  • 13 - Invalid value for a field. Field has fixed vocabulary.
  • 14 - Error parsing sent XML.
  • 21 - Cannot use both 'allcatalogs' and 'othercatalogs' same time.
  • 22 - Empty queries not allowed.
  • 101 - Schema already exists.

Methods

Session

  • newSession(uid, pwd)

Creates a new session.

uid - username
pwd - password

Returns a session ID or error 2
Sample response:

      <response><status>0</status><sessionId>0f2nh0893h028hf320h20</sessionId></response>
  • closeSession(sessId)

Closes current session

sessId - session ID to finish

Returns with a response status 0 or 1

  • Identify(sessId)

Identifies client and returns some information about Waramu's configuration.

suffix - client's suffix or identification string.

baseweburl - URL where Waramu's web interface is installed.

Schema

  • listTypes(sessId)

Lists all resource typed currently available on Waramu repository.

sessId - session Id

Returns a list of types or status 1

  • describeType(sessId, typeId)

Type description.

sessId - session Id
typeId - type Id.

Returns a Waramu XML describing resource type or 1

  • registerSchema(sessId, schema)

Register a new schema in Waramu

sessId - session ID
schema - XML document containing a type description

  • modifySchema(sessId, schema)

Same as registerSchema but modifies existing.

  • newResource(appUser, sessId, data)

Creates a new resource on Waramu repository

appUser - information about enduser eg. portal user
sessId - session ID
data - Waramu XML representation of metadata.

Returns an ID of created resource or status 1, 2, 4, 7, 13, 14

  • updateResource(appUser, sessId, uid, data)

Updates resource metadata in repository.

appUser - information about enduser eg. portal user
sessId - session ID
uid - Id of a resource.
data - Waramu XML representation of metadata.

Returns status 0 on success or status 1, 5, 7, 8, 13, 14.

  • setACL(appUser, sessId, uid, acl)

Updated resource's access control list. See Access Control section.

Note: Implementation is not yet finished.

Returns status 0 on success.

  • getResource(appUser, sessId, uid)

Returns a Waramu XML representation of resource's metadata.
appUser - information about enduser. Can be empty.
sessId - session ID
uid - resource Id.

Returns status 0 on success or 1, 5, 8

  • deleteResource(appUser, sessId, uid)

Deletes a resource from repository.

appUser - information about enduser eg. portal user
sessId - session ID
uid - resource Id.

Returns 0 or 5, 7, 8

  • addAttachment(appUser, sessId, resourceId, attachment, filename)

Adds an attachment to resource description/metadata.

appUser - information about enduser eg. portal user
sessId - session ID
resourceId - resource Id.
attachment - binary.
filename - Name of an attachment.

Returns a list of attachments currently attached to resource or status 1, 5, 6, 7, 8

  • listAttachments(appUser, sessId, resourceId)

Lists all attachments bound with a resource.

appUser - information about enduser. Can be empty.
sessId - session ID
resourceId - resource Id.

  • removeAttachment(appUser, sessId, resourceId, attachmentId)

Removes an attachment from resource.

appUser - information about enduser eg. portal user
sessId - session ID
resourceId - resource Id.
attachmentId - Id of an attachment

  • getAttachment(appUser, sessId, resourceId, attachmentId)

Returns an attachment as a bytes or throws an exception.

appUser - information about enduser. Can be empty.
sessId - session ID
resourceId - resource Id.
attachmentId - Id of an attachment

  • listIdentifiers(appUser, sessId, query)

Search resources from Waramu repository.

appUser - information about enduser. Can be empty.
sessId - session ID
query - query in Waramu query format.

Returns a list of resource IDs matching query.

Sample response:

   <response>
     <status>0</status>
     <identifiers>
       <id>ef020fn23fn</id>
       <id>0d12mn302n3</id>
       ...
     </identifiers>
   </response>