<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[CloudForms Now]]></provider_name><provider_url><![CDATA[http://cloudformsblog.redhat.com]]></provider_url><author_name><![CDATA[johnhardy36]]></author_name><author_url><![CDATA[https://cloudformsblog.redhat.com/author/johnhardy36/]]></author_url><title><![CDATA[SOAP &#8211; SAVON v2&nbsp;Syntax]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><a href="http://redhatmanagement.files.wordpress.com/2014/07/soap-on-a-rope-560x328.jpg"></a><img data-attachment-id="313" data-permalink="https://cloudformsblog.redhat.com/2014/07/15/soap-savon-v2-syntax/soap-on-a-rope-560x328/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2014/07/soap-on-a-rope-560x328.jpg" data-orig-size="560,328" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Soap-On-A-Rope-560&#215;328" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2014/07/soap-on-a-rope-560x328.jpg?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2014/07/soap-on-a-rope-560x328.jpg?w=560" class="aligncenter size-full wp-image-313" src="https://cloudformsredhat.files.wordpress.com/2014/07/soap-on-a-rope-560x328.jpg" alt="" /></p>
<p>&nbsp;</p>
<p>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.</p>
<p>What does this mean? Well v2 has a slightly different syntax to its connections and function call. Here is a v2 SOAP example:<!--more--></p>
<pre class="brush: ruby; title: ; notranslate" title="">
require 'savon'

client = Savon.client do | globals |
globals.wsdl &quot;https://x.x.x.x/vmdbws/wsdl&quot;
globals.basic_auth [&quot;admin&quot;, &quot;smartvm&quot;]
globals.ssl_verify_mode :none
globals.ssl_version :TLSv1
end

body_hash = {}
body_hash['version'] = '1.1'
body_hash['uri_parts'] = &quot;namespace=Sample|class=Methods|instance=InspectMe|message=create&quot;
body_hash['parameters'] = &quot;&quot;
body_hash['requester'] = &quot;auto_approve=true&quot;

response = client.call(:create_automation_request, message: body_hash)
</pre>
<p>Notice that the client call is different, and also the document is now just wsdl.</p>
<p>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;</p>
<pre class="brush: ruby; title: ; notranslate" title="">
require 'rubygems'
gem 'savon', '= 1.1.0'
require 'savon'
</pre>
<p>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.</p>
<p>Really the advice I give here is that;</p>
<ul>
<li>If you are running your scripts REMOTE to the appliance then either upgrade your syntax to v2 or force the scripts to use v1 Savon gem.</li>
<li>If your script is running LOCAL to the appliance, change your syntax to v2.</li>
<li>If you are writing a NEW script, use the v2 syntax (and specify the version in your script like a happy scripter would do!)</li>
</ul>
<p>Hope this helps.</p>
<p>Savon web site is <a href="http://savonrb.com/version2/" target="_blank" rel="noopener">http://savonrb.com/version2/</a></p>
]]></html><thumbnail_url><![CDATA[https://cloudformsredhat.files.wordpress.com/2014/07/soap-on-a-rope-560x328.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[258]]></thumbnail_height></oembed>