Search code examples
ruby-on-railssavon

ruby Savon use camelcase instead snake


i'm using savon gem for SOAP request building, i need snake_case_elements, but when i inspect it seems converted to CamelCase, am i missing something here? Here is a result

enter image description here

And how i did it:

    gls_url = 'https://adi-test.gls-poland.pl/adeplus/pm1/ade_webapi2.php?wsdl'
username = '612305291'
password = 'KGpartt2016'

@client = Savon.client(wsdl: gls_url,  
                      log: true,
                      logger: Rails.logger,
                      log_level: :debug,
                      pretty_print_xml: true)

ats = @client.call(:ade_login, message: {
                                          user_name: username, 
                                          user_password: password
                                        })

Solution

  • You can use convert_request_keys_to option to tell Gyoku how to convert the keys (if at all):

    @client = Savon.client(wsdl: gls_url, convert_request_keys_to: :none)