EOFError: end of file reached calling a SOAP API via Savon ruby client
EOFError: end of file reached calling a SOAP API via Savon ruby client
提到的错误是在防火墙后面调用 API,但我正在尝试从 EngineYard 实例访问 API。 EngineYard 实例 IP 在其防火墙中列入白名单。
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]
我收到以下错误
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
有什么想法吗?
问题是 @additional_attributes
是 nil
而 WSDL 需要一个数组。
提到的错误是在防火墙后面调用 API,但我正在尝试从 EngineYard 实例访问 API。 EngineYard 实例 IP 在其防火墙中列入白名单。
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]
我收到以下错误
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
有什么想法吗?
问题是 @additional_attributes
是 nil
而 WSDL 需要一个数组。