why is XML-RPC client prog not running??

P

Pankaj Kumar

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:in
`call2'
from /usr/local/lib/ruby/site_ruby/1.8/xmlrpc/client.rb:372:in
`call'
from ruby_c.rb:9
where is the problem?
 
P

Phil Tomson

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:in
`call2'
from /usr/local/lib/ruby/site_ruby/1.8/xmlrpc/client.rb:372:in
`call'
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
 
P

Pankaj Kumar

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

*************************************
 
F

Florian Frank

Pankaj said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top