Skip to content

Instantly share code, notes, and snippets.

@rubiii
Last active December 15, 2015 11:29
Show Gist options
  • Select an option

  • Save rubiii/5253233 to your computer and use it in GitHub Desktop.

Select an option

Save rubiii/5253233 to your computer and use it in GitHub Desktop.
simple example for communicating with the smartmover soap service using savon
# how to:
#
# 1. find the wsdl file (usually available at #{soap_endpoint + '?wsdl'}) like this:
# https://smartmover.melissadata.net/V2b/Smartmover.asmx?wsdl
#
# 2. throw the wsdl at soapUI (get it, it's free: http://www.soapui.org) and create
# a sample request for the 'DoSmartMover' operation.
#
# 3. use the xml type names from the sample request to create a message hash with the
# hash keys matching the xml tag names.
require 'savon' # REQUIRES: Savon v2.1.0 - http://savonrb.com/version2.html
wsdl = 'https://smartmover.melissadata.net/V2b/Smartmover.asmx?wsdl'
message = { 'RequestArray' => { 'CustomerID' => 1, 'PAFId' => 6 } }
# TODO: add all non-optional message parameters.
client = Savon.client(:wsdl => wsdl)
client.call(:do_smart_mover, :message => message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment