title: Passing Array Elements for Savon 2 (SOAP)
body: <p>I'm trying to write code in Ruby with the Savon gem (v2) that fetches account information from a SOAP api, but I'm having an issue with passing an Array.</p>
  
  <p><code>CampaignIds</code> is supposed to be an array of integers.  </p>
  
  <p>Here is my code:</p>
  
  <pre><code>client = Savon.client(wsdl: "https://api7secure.publicaster.com/Pub7APIV1/Campaign.svc?singleWsdl")
  
  message = {
    "EncryptedAccountID" =&gt; api_key,
    "APIPassword" =&gt; api_password,
    "CampaignIds" =&gt; [3,4],
    "StartDate" =&gt; yesterday,
    "EndDate" =&gt; yesterday,
    "IncludeTests" =&gt; false
  }
  
  client.call(:get_comparative_report_details_data, message: message)
  </code></pre>
  
  <p>which produces the following request:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:tns="http://BlueSkyFactory.Publicaster7.Public.API" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
     &lt;env:Body&gt;
        &lt;tns:GetComparativeReportDetailsData&gt;
           &lt;tns:EncryptedAccountID&gt;*****&lt;/tns:EncryptedAccountID&gt;
           &lt;tns:APIPassword&gt;*****&lt;/tns:APIPassword&gt;
           &lt;tns:CampaignIds&gt;3&lt;/tns:CampaignIds&gt;
           &lt;tns:CampaignIds&gt;4&lt;/tns:CampaignIds&gt;
           &lt;tns:StartDate&gt;2014-01-06&lt;/tns:StartDate&gt;
           &lt;tns:EndDate&gt;2014-01-06&lt;/tns:EndDate&gt;
           &lt;tns:IncludeTests&gt;false&lt;/tns:IncludeTests&gt;
        &lt;/tns:GetComparativeReportDetailsData&gt;
     &lt;/env:Body&gt;
  &lt;/env:Envelope&gt;
  </code></pre>
  
  <p>whereas, if I play around in SOUP UI, the request should look like:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:blu="http://BlueSkyFactory.Publicaster7.Public.API" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;blu:GetComparativeReportData&gt;
           &lt;blu:EncryptedAccountID&gt;*****&lt;/blu:EncryptedAccountID&gt;
           &lt;blu:APIPassword&gt;*****&lt;/blu:APIPassword&gt;
           &lt;blu:CampaignIds&gt;
              &lt;arr:int&gt;3&lt;/arr:int&gt;
              &lt;arr:int&gt;4&lt;/arr:int&gt;
           &lt;/blu:CampaignIds&gt;
           &lt;blu:StartDate&gt;2014-01-06T16:21:47-05:00&lt;/blu:StartDate&gt;
           &lt;blu:EndDate&gt;2014-01-07T16:21:47-05:00&lt;/blu:EndDate&gt;
           &lt;blu:IncludeTests&gt;false&lt;/blu:IncludeTests&gt;
        &lt;/blu:GetComparativeReportData&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Any Ideas?</p>