Why is XML-RPC client prog not running?

Hi!all
when i run ruby client program(which simply adds& subtracts two numbers
by making XML-RPC call to ruby server program stored in cgi-bin
directory of apache server), it’s giving following error
/usr/local/lib/ruby/site_ruby/1.8/xmlrpc/client.rb:502:in do_rpc': HTTP-Error: 500 Internal Server Error (RuntimeError) from /usr/local/lib/ruby/site_ruby/1.8/xmlrpc/client.rb:382:incall2’
from /usr/local/lib/ruby/site_ruby/1.8/xmlrpc/client.rb:372:in
`call’
from ruby_c.rb:9
where is the problem?

On 9/1/06, Pankaj K. [email protected] wrote:

`call’
from ruby_c.rb:9
where is the problem?

On the server. For a longer answer you need elaborate more.

On 9/1/06, Pankaj K. [email protected] wrote:

   from ruby_c.rb:9

where is the problem?

can you post your code?
Also, you say you’re using Apache as the server (or I’m assuming that
from the fact that you mention that the ruby server program is stored
in the cgi-bin directory of apache server). Perhaps you should try to
get it working with the webrick server built-in to Ruby’s XML-RPC
first and then move to apache - that way you can eliminate apace setup
problems as the possible culprit.

Phil

Hi! guys,
below are client as well as server code…(i’ve simply copied the
programs from the web
site"http://www.tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-ruby.html").
i’ve already installed xmlrpc4r-1_7_16 as`well as xmlparser-0.6.8 in my
computer…please see why they are not running??


#client side prog(ruby_c.rb)

require “xmlrpc/client”

Make an object to represent the XMLâ??RPC server.

server = XMLRPC::Client.new( “127.0.0.1”, “/cgi-bin/ruby_s.rb”,80)

Call the remote server and get our result

result = server.call(“sample.sumAndDifference”, 5, 3)

sum = result[“sum”]
difference = result[“difference”]
puts “Sum: #{sum}, Difference: #{difference}”


#server side prog(ruby_s.rb)

require “xmlrpc/server”

s = XMLRPC::CGIServer.new

s.add_hanlder(“sample.sumAndDifference”) do |a,b|
{ “sum” => a + b, “difference” => a - b }
end

s.serve


Phil T. wrote:

On 9/1/06, Pankaj K. [email protected] wrote:

   from ruby_c.rb:9

where is the problem?

can you post your code?
Also, you say you’re using Apache as the server (or I’m assuming that
from the fact that you mention that the ruby server program is stored
in the cgi-bin directory of apache server). Perhaps you should try to
get it working with the webrick server built-in to Ruby’s XML-RPC
first and then move to apache - that way you can eliminate apace setup
problems as the possible culprit.

Phil

Pankaj K. wrote:

below are client as well as server code…(i’ve simply copied the
programs from the web
site"http://www.tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-ruby.html").

This howto seems to contain a spelling mistake, that you copied as well:


#server side prog(ruby_s.rb)

require “xmlrpc/server”

s = XMLRPC::CGIServer.new

s.add_hanlder(“sample.sumAndDifference”) do |a,b|
s.add_handler(…
{ “sum” => a + b, “difference” => a - b }
end

s.serve

You should try to find the place where your http server writes its
logfile to and observe it, in order to find out what the exact cause of
server errors is.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs