Rails 3:Soap4r 返回“断言:未知数组定义”针对 Akamai 请求

发布于 2025-01-08 14:49:34 字数 3505 浏览 0 评论 0原文

升级我们应用程序中的某些内容,现在我们向 Akamai 发出的肥皂请求未触发。相反,单元测试会导致返回 RuntimeError: Assert: Unknown arrayDefinition

这是 akamai 类:

require 'rexml/document'

class Akamai
  def self.purge_cache(url)
    require 'soap/wsdlDriver'
    factory = SOAP::WSDLDriverFactory.new('https://ccuapi.akamai.com/ccuapi-axis.wsdl')
    driver = factory.create_rpc_driver
    driver.purgeRequest(
      'our-username', # username
      'our-password', # password
      '', # network; deprecated
      [], # options
      [url]
      )
  end
end

我认为这可能是我添加到升级分支中的一些新 gem,但只有两个添加内容Gemfile:

gem 'libxml-ruby', '1.1.4'
gem 'nokogiri'

删除它们并不能解决问题。这是错误喷出:

test_unsuccessful_purge(AkamaiTest):
RuntimeError: Assert: Unknown array definition.
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/wsdl/soap/complexType.rb:122:in `find_arytype'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/wsdl/soap/complexType.rb:161:in `content_arytype'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/wsdl/soap/complexType.rb:55:in `child_type'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:168:in `array2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:145:in `complexobj2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:121:in `obj2typesoap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:38:in `obj2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:135:in `_obj2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:54:in `block (2 levels) in objs2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:52:in `upto'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:52:in `block in objs2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:560:in `block in protect_mapping'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:533:in `protect_threadvars'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:549:in `protect_mapping'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:51:in `objs2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:475:in `request_rpc_enc'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:457:in `request_rpc'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:412:in `request_body'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:127:in `call'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/driver.rb:151:in `call'
    (eval):6:in `purgeRequest'
    /Users/kevin/code/medialytics/app/models/akamai.rb:8:in `purge_cache'
    test/unit/akamai_test.rb:12:in `block in <class:AkamaiTest>'

Upgrading some things in our app, and now our soap requests to Akamai aren't firing. Unit tests instead cause a return of RuntimeError: Assert: unknown array definition

Here's the akamai class:

require 'rexml/document'

class Akamai
  def self.purge_cache(url)
    require 'soap/wsdlDriver'
    factory = SOAP::WSDLDriverFactory.new('https://ccuapi.akamai.com/ccuapi-axis.wsdl')
    driver = factory.create_rpc_driver
    driver.purgeRequest(
      'our-username', # username
      'our-password', # password
      '', # network; deprecated
      [], # options
      [url]
      )
  end
end

I thought it might be some new gems I've added onto our upgraded branch, but there are only two additions to the Gemfile:

gem 'libxml-ruby', '1.1.4'
gem 'nokogiri'

Removing them doesn't fix the problem though. Here's the error spew:

test_unsuccessful_purge(AkamaiTest):
RuntimeError: Assert: Unknown array definition.
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/wsdl/soap/complexType.rb:122:in `find_arytype'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/wsdl/soap/complexType.rb:161:in `content_arytype'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/wsdl/soap/complexType.rb:55:in `child_type'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:168:in `array2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:145:in `complexobj2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:121:in `obj2typesoap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/wsdlencodedregistry.rb:38:in `obj2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:135:in `_obj2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:54:in `block (2 levels) in objs2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:52:in `upto'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:52:in `block in objs2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:560:in `block in protect_mapping'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:533:in `protect_threadvars'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:549:in `protect_mapping'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/mapping/mapping.rb:51:in `objs2soap'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:475:in `request_rpc_enc'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:457:in `request_rpc'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:412:in `request_body'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/proxy.rb:127:in `call'
    /Users/kevin/.rvm/gems/ruby-1.9.2-p0@media3/gems/soap4r-ruby1.9-2.0.3/lib/soap/rpc/driver.rb:151:in `call'
    (eval):6:in `purgeRequest'
    /Users/kevin/code/medialytics/app/models/akamai.rb:8:in `purge_cache'
    test/unit/akamai_test.rb:12:in `block in <class:AkamaiTest>'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三五鸿雁 2025-01-15 14:49:34

我最终放弃了soap4r-ruby1.9并选择了Savon,因为它最近更新了并且似乎更好地组合在一起。

I ended up dumping soap4r-ruby1.9 all together and going with Savon, since it's been updated more recently and seems to be better put-together.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文