Last active
August 7, 2017 09:40
-
-
Save exlcodeshare/d20f1a9258dae8b2fb2f7bd2b548fe56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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