Index: [Article Count Order] [Thread]

Date:  Sun, 21 Nov 2004 18:42:10 +0000
From:  Richard Turner <richard@...>
Subject:  SOAP and Apache
To:  modruby@... (modruby ML)
Message-Id:  <1101062530.3239.26.camel@...>
X-Mail-Count: 01358



Hi,

I've just started investigating Ruby as an alternative to creating a
number of Web services using PHP and SOAP over HTTP.  I'd like to create
a server script that works through Apache and mod_ruby rather than using
a Ruby web server.

I've hit a stumbling block almost immediately: my simple SOAP client
script (accessing a SOAP server that's already been written in PHP),
falls over because the wsdlDriver module uses instance_eval.  Here's the
script, followed by the output when using mod_ruby:

-----

require 'soap/wsdlDriver'

WSDL_URI =3D 'http://pickwick/pickwick.php?wsdl'
pickwick =3D SOAP::WSDLDriverFactory.new(WSDL_URI).create_driver
pickwick.generate_explicit_type =3D true

# Uncomment to see SOAP transactions (debugging)
#pickwick.wiredump_dev =3D STDERR

cats =3D pickwick.GetCategories

cats.each do |cat|
   print cat.id, "\t", cat.description, "\n"
end

items =3D pickwick.GetItemList('15.09.13')

items.each do |item|
   print item.id, "\t", item.name, "\n"
end

-----

Ruby Error: /ruby/client.rbx

/usr/lib/ruby/1.8/soap/wsdlDriver.rb:379:in `instance_eval': Insecure opera=
tion - instance_eval (SecurityError)
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:379:in `add_rpc_method_interfac=
e'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:361:in `add_method_interface'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:190:in `initialize'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:188:in `each'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:188:in `initialize'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:134:in `new'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:134:in `initialize'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:60:in `new'
  from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:60:in `create_driver'
  from /home/rjt/pickwick/ruby/client.rbx:13
  from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `load'
  from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler'

-----

The same script, with minor modifications, runs fine using CGI.  I don't
want to configure Apache to use a security level of zero because that
defies the point of having security at all.  I'm only just beginning to
learn Ruby too, so I don't really fancy hacking wsdlDriver and can't
believe that I should have to.

Of course, that's just the start of my problems.  Once the client works
I need to create a new server and I've no idea how to go about doing
that using Apache.  How does one access the HTTP request from Apache and
parse it to extract the SOAP to pass on to the server?

Thanks for any help!

Cheers,

Richard.
--=20
"Racing turtles, the grapefruit is winning..."



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBoOGC7wcpQjDyc54RAvI5AJ4jDYwjJ2YcaP9ZTJztT1gAehLKIwCglmVS
U4uguqrcfL/gKaX4xqlh+yI=
=OnD4
-----END PGP SIGNATURE-----