Skip to content

Instantly share code, notes, and snippets.

@exlcodeshare
Last active August 7, 2017 09:40
Show Gist options
  • Save exlcodeshare/d20f1a9258dae8b2fb2f7bd2b548fe56 to your computer and use it in GitHub Desktop.
Save exlcodeshare/d20f1a9258dae8b2fb2f7bd2b548fe56 to your computer and use it in GitHub Desktop.
require 'savon'
require 'base64'
if ARGV.length < 2
puts "usage: ./set_collection_thumbnail.rb pdsHandle collectionId"
exit
end
# point wsdl to repository load balancer
wsdl = 'https://rosetta.exlibrisgroup.com/dpsws/repository/CollectionWebServices?wsdl'
image = "C:/Temp/"+ARGV[1]+"_thumb.jpg"
namespaces = {
"xmlns:dps" => "http://dps.exlibris.com"
}
client = Savon.client(wsdl: wsdl, env_namespace: :soapenv, namespaces: namespaces, log_level: :warn)
message = {pdsHandle: ARGV[0], collectionId: ARGV[1], collection_thumbnail: Base64.encode64(File.open(image, "rb").read)}
response = client.call(:set_collection_thumbnail, message: message)
puts response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment