Q:

EOFError: end of file reached calling a SOAP API via Savon ruby client

The mentioned error comes calling an API behind a firewall but and I am trying to access the API from an EngineYard instance. The EngineYard instances IPs are white listed in their firewall.
client = Savon.client(wsdl: "https://amagentostore.com/api/v2_soap?wsdl", read_timeout: 300, follow_redirects: true)
products = client.
          call(:dcapimodule_product_list, message: { session_id: session_id, additional_attributes: @additional_attributes }).
          body[:dcapimodule_product_list_response][:products][:item]

I get the following error
File "/usr/lib64/ruby/2.3.0/openssl/buffering.rb" line 178 in sysread_nonblock
File "/usr/lib64/ruby/2.3.0/openssl/buffering.rb" line 178 in read_nonblock
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/excon-0.59.0/lib/excon/socket.rb" line 46 in readline
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/excon-0.59.0/lib/excon/response.rb" line 63 in parse
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/excon-0.59.0/lib/excon/middlewares/response_parser.rb" line 7 in response_call
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/excon-0.59.0/lib/excon/connection.rb" line 389 in response
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/excon-0.59.0/lib/excon/connection.rb" line 253 in request
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/excon-0.59.0/lib/excon/connection.rb" line 314 in post
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/httpi-2.4.2/lib/httpi/adapter/excon.rb" line 25 in request
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/httpi-2.4.2/lib/httpi.rb" line 161 in request
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/httpi-2.4.2/lib/httpi.rb" line 133 in post
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/savon-2.11.2/lib/savon/operation.rb" line 94 in block in call_with_logging
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/savon-2.11.2/lib/savon/request_logger.rb" line 12 in log
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/savon-2.11.2/lib/savon/operation.rb" line 94 in call_with_logging
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/savon-2.11.2/lib/savon/operation.rb" line 54 in call
File "/data/feed_champion/shared/bundled_gems/ruby/2.3.0/gems/savon-2.11.2/lib/savon/client.rb" line 36 in call
File "/data/feed_champion/releases/20180110042633/app/services/magento/product.rb" line 84 in products

Any idea?

A:

The problem was @additional_attributes was being nil while the WSDL was expecting an array.

