1

I updated my Savon version to 0.9.6 and my server requests seem to be malforming. Before the update, I was using Savon 0.9.2.

I have a similar problem as someone mentioned in the post below, however, it differs in that the repeated items include full objects. I've tried using arrays, with no luck. Savon: How can I specify a custom XML in a hash body for a SOAP request?

The requests are built this way:

#Address object
address =  {
      'AddressCode' => 'Dest',
      'Line1' => '1234 Anywhere Street',
      'City' => 'Anywhere',
      'Region' => 'Somewhere',
      'PostalCode' => '12345',
      'Country' => 'USA'
          }
#Building the request
request = {"Request" => {
      'CompanyCode' => 'DEFAULT',
      'DocType' => 'Word',
      'Addresses' => {'BaseAddress' => [address]}
          }}

0.9.6 (Broken) Request portion

   <ser:Request>
            <ser:CompanyCode>DEFAULT</ser:CompanyCode>
            <ser:DocType>Word</ser:DocType>            
            <ser:Addresses>
               <ins0:Addresses>
               <ins0:BaseAddress>AddressCodeDestLine11234 Anywhere StreetCityAnywhere RegionSomewherePostalCode12345CountryUS</ins0:BaseAddress>
            </ser:Addresses>           
         </ser:Request>

0.9.2 (Working) Request portion

<ser:Request>
    <ser:CompanyCode>DEFAULT</ser:CompanyCode>
    <ser:DocType>Word</ser:DocType>            
    <ser:Addresses>
       <ser:BaseAddress>
          <ser:AddressCode>Dest</ser:AddressCode>
          <ser:Line1>1234 Anywhere Street</ser:Line1>
          <ser:City>Anywhere</ser:City>
          <ser:Region>Somewhere</ser:Region>
          <ser:PostalCode>12345</ser:PostalCode>
          <ser:Country>US</ser:Country>
       </ser:BaseAddress>
    </ser:Addresses>           
 </ser:Request>

Does anyone have any ideas? I would really appreciate any advice you are willing to offer.

Thank you!

Community
  • 1
  • 1
Sc0rpio
  • 189
  • 2
  • 4
  • 12
  • I'm affected by this issue too. Seems to be caused by this commit in 0.9.6 -> https://github.com/rubiii/savon/commit/2f7df2412bb6ea766cd2b36107eee4270de25185 – edmz Aug 22 '11 at 23:35

0 Answers0