CloudForms Now

SOAP – SAVON v2 Syntax

 

So for the past few years Savon v1.1.0 has been the default GEM in the appliance. Heres a scoop! In future releases, and the upstream builds have Savon v2.

What does this mean? Well v2 has a slightly different syntax to its connections and function call. Here is a v2 SOAP example:


require 'savon'

client = Savon.client do | globals |
globals.wsdl "https://x.x.x.x/vmdbws/wsdl"
globals.basic_auth ["admin", "smartvm"]
globals.ssl_verify_mode :none
globals.ssl_version :TLSv1
end

body_hash = {}
body_hash['version'] = '1.1'
body_hash['uri_parts'] = "namespace=Sample|class=Methods|instance=InspectMe|message=create"
body_hash['parameters'] = ""
body_hash['requester'] = "auto_approve=true"

response = client.call(:create_automation_request, message: body_hash)

Notice that the client call is different, and also the document is now just wsdl.

Another option for you if you wish to work with older v1.1.0 syntax scripts, then simply add to the top of your scripts;


require 'rubygems'
gem 'savon', '= 1.1.0'
require 'savon'

This will allow you to use your script as is, but forcing it to use the v1.1.0 Savon GEM. I have documented this route in the thinking that you are running your script REMOTE to the appliance. This is not a proposed route for modifying existing scripts running in an appliance.

Really the advice I give here is that;

Hope this helps.

Savon web site is http://savonrb.com/version2/