More Soap4r Fun

Published on 02 May 2007 by James in Ruby

0

In the continuing saga of making soap4r work under Rails, I’ve found another issue that needs to be noted. Under some operating systems, the following exception was being raised:

soap4r-1.5.5.20061022/lib/xsd/xmlparser/parser.rb:33:in `create_parser': You have a nil object when you didn't expect it! (NoMethodError)

If you see this error, there is a Google Groups discussion that documents the fix. Here are the steps I took to fix the problem, since the fix exists in soap4r’s subversion repository but not in the latest gem release:

  1. Checkout the latest soap4r sourcecode: svn checkout http://dev.ctor.org/svn/soap4r/trunk soap4r
  2. Inside the soap4r project root, run: rake package
  3. Uninstall the soapr4 gem: gem uninstall soap4r
  4. Install the locally created soap4r gem: gem install pkg/soap4r-1.5.5.20061004.gem
  5. (Bonus) Prior to creating the gem using the rake command, edit the soap4r.gemspec and change the name and/or version of the gem so that it will be different than the current production version. You’ll then remember that you have a custom-built version rather than the last gem release

My project now works both in development and production from within Rails and with the latest soap4r snapshot to communicate with our Lyris ListManager via SOAP. I hope this helps you out on your soap and Rails adventures as well!

[tags]ruby, ruby on rails, soap, soap4r, lyris[/tags]

Leave a Reply