gpt4 book ai didi

ruby - 尝试使用 soap4r 使用 soap 服务时找不到 Xml 处理器模块错误

转载 作者:数据小太阳 更新时间:2023-10-29 07:27:27 26 4
gpt4 key购买 nike

我正在尝试通过 soap4r gem 使用 soap 网络服务。我正在使用

ryby 1.8.7
rails 2.3.4
soap4r 1.5.8
rhodes 3.2.3

我在 IRB 中尝试了以下方法。

require "rubygems"
require "soap/wsdlDriver"


wsdl = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver

driver.wiredump_dev = STDOUT

params = {
"Celsius" => 32
}

driver.CelsiusToFahrenheit(params)

我收到了回复。我在罗德岛也试过同样的方法。

  1. 我在 rhodes 应用程序中添加了扩展文件夹。
  2. 我复制了里面的soap,wsdl,xsd和tags文件夹\Ruby187\lib\ruby\gems\1.8\gems\soap4r-1.5.8\lib 在我的系统中。

  3. 我在 build.yml 文件中添加了 soap 作为扩展

  4. 我需要以下内容

    require 'soap/soap'
    require 'soap/wsdlDriver'

我得到以下信息。

I 01/25/2012 11:07:08:059 000015ac              RhoRuby| require_compiled: Product/product_controller
I 01/25/2012 11:07:08:060 000015ac RhoRuby| require_compiled: soap/soap
I 01/25/2012 11:07:08:062 000015ac RhoRuby| require_compiled: xsd/qname
I 01/25/2012 11:07:08:063 000015ac RhoRuby| require_compiled: xsd/charset
I 01/25/2012 11:07:08:065 000015ac RhoRuby| require_compiled: xsd/iconvcharset
E 01/25/2012 11:07:08:066 000015ac RhoRuby| require_compiled: error: can not find iconv
E 01/25/2012 11:07:08:067 000015ac RhoRuby| require_compiled: error: can not find nkf
E 01/25/2012 11:07:08:067 000015ac RhoRuby| require_compiled: error: can not find uconv
I 01/25/2012 11:07:08:067 000015ac RhoRuby| require_compiled: soap/nestedexception
I 01/25/2012 11:07:08:069 000015ac RhoRuby| require_compiled: soap/wsdlDriver
I 01/25/2012 11:07:08:074 000015ac RhoRuby| require_compiled: wsdl/parser
I 01/25/2012 11:07:08:076 000015ac RhoRuby| require_compiled: xsd/datatypes
I 01/25/2012 11:07:08:085 000015ac RhoRuby| require_compiled: date
I 01/25/2012 11:07:08:086 000015ac RhoRuby| require_compiled: dateOrig
I 01/25/2012 11:07:08:100 000015ac RhoRuby| require_compiled: date/format

I 01/25/2012 11:07:08:112 000015ac              RhoRuby| require_compiled: xsd/xmlparser
I 01/25/2012 11:07:08:114 000015ac RhoRuby| require_compiled: xsd/xmlparser/parser
I 01/25/2012 11:07:08:115 000015ac RhoRuby| require_compiled: xsd/ns
I 01/25/2012 11:07:08:117 000015ac RhoRuby| require_compiled: xsd/xmlparser/xmlparser
E 01/25/2012 11:07:08:118 000015ac RhoRuby| require_compiled: error: can not find xml/parser
I 01/25/2012 11:07:08:118 000015ac RhoRuby| require_compiled: xsd/xmlparser/xmlscanner
E 01/25/2012 11:07:08:120 000015ac RhoRuby| require_compiled: error: can not find xmlscan/scanner
I 01/25/2012 11:07:08:120 000015ac RhoRuby| require_compiled: xsd/xmlparser/rexmlparser
E 01/25/2012 11:07:08:121 000015ac RhoRuby| require_compiled: error: can not find rexml/streamlistener
I 01/25/2012 11:07:08:121 000015ac APP| App error: XML processor module not found.
C:/Spritle/Projects/mobile_projects/netHTTPtrial/extensions/soap/xsd/xmlparser.rb:74:in `<top (required)>'
C:/Spritle/Projects/mobile_projects/netHTTPtrial/extensions/soap/wsdl/parser.rb:12:in `require'
C:/Spritle/Projects/mobile_projects/netHTTPtrial/extensions/soap/wsdl/parser.rb:12:in `<top (required)>'
C:/Spritle/Projects/mobile_projects/netHTTPtrial/extensions/soap/soap/wsdlDriver.rb:9:in `require'
C:/Spritle/Projects/mobile_projects/netHTTPtrial/extensions/soap/soap/wsdlDriver.rb:9:in `<top (required)>'
C:/Spritle/Projects/mobile_projects/netHTTPtrial/app/Product/product_controller.rb:3:in `require'
C:/Spritle/Projects/mobile_projects/netHTTPtrial/app/Product/product_controller.rb:3:in `<top (required)>'

在调用 xmlParser 之后只抛出一个错误。我不知道。如果你认识某人,请帮助我。

最佳答案

我有同样的错误。按照 this post 中的说明进行操作为我解决了问题:

在soap4r/xsd/charset.rb开头@internal_encoding = (RUBY_VERSION.to_f >= 1.9) ? 'UTF8' : $K代码

然后更改/soap4r-1.5.8/lib/xsd/xmlparser.rb 中的第 66 行进入c.to_s.downcase == 名字

关于ruby - 尝试使用 soap4r 使用 soap 服务时找不到 Xml 处理器模块错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8998496/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com