The xml processor module did not detect an error while trying to use a soap service using soap4r

I am trying to use a soapy web service from soap4r gem. I use

ryby 1.8.7 rails 2.3.4 soap4r 1.5.8 rhodes 3.2.3 

I tried the following in 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) 

I got an answer. I tried the same in Rhodes.

  • I am adding the extensions folder to the rhodes application.
  • I copied folders with soap, wsdl, xsd and tags inside \Ruby187\lib\ruby\gems\1.8\gems\soap4r-1.5.8\lib on my system.

  • I added soap as an extension to my build.yml file

  • I needed the following

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

I get the following.

 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)>' 

After calling xmlParser only errors. I have no idea. If you know someone, please help me.

+4
source share
3 answers

I had the same error. Following the instructions in this post , I solved the problem for me:

At the beginning of soap4r / xsd / charset.rb @internal_encoding = (RUBY_VERSION.to_f> = 1.9)? 'UTF8': $ KCODE

Then change line 66 to / soap 4r-1.5.8 / lib / xsd / xmlparser.rb in c.to_s.downcase == name

+6
source

Row change

  c.downcase == name 

in c.to_s.downcase == name

in gems / soap4r-1.5.8 / lib / xsd / xmlparser.rb, line 76 worked for me. Maybe an older version treated the character as a string.

+1
source

I am running ruby-1.8. I had to do a name.downcase to get this to work. c.to_s.downcase == name.downcase

0
source

Source: https://habr.com/ru/post/1392851/


All Articles