# Why is XML-RPC client prog not running?

**URL:** <https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256>\
**Category:** Ruby\
**Created:** [September 1, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256 "2006-09-01T17:31:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankajkumar144](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@pankajkumar144](https://www.ruby-forum.com/u/pankajkumar144)\
**Post date:** [September 1, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256/1 "2006-09-01T17:31:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pankajkumar144](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@pankajkumar144](https://www.ruby-forum.com/u/pankajkumar144)\
**Post date:** [September 1, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256/2 "2006-09-01T18:50:58Z")

</div>

On 9/1/06, Pankaj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> `call’  
> from ruby\_c.rb:9  
> where is the problem?

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

---

<div class="post-metadata">

**Author:** ![pankajkumar144](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@pankajkumar144](https://www.ruby-forum.com/u/pankajkumar144)\
**Post date:** [September 1, 2006, 7:03pm UTC](https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256/3 "2006-09-01T19:03:06Z")

</div>

On 9/1/06, Pankaj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![pankajkumar144](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@pankajkumar144](https://www.ruby-forum.com/u/pankajkumar144)\
**Post date:** [September 2, 2006, 10:11am UTC](https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256/4 "2006-09-02T10:11:23Z")

</div>

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](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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![pankajkumar144](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@pankajkumar144](https://www.ruby-forum.com/u/pankajkumar144)\
**Post date:** [September 21, 2006, 12:37pm UTC](https://www.ruby-forum.com/t/why-is-xml-rpc-client-prog-not-running/67256/5 "2006-09-21T12:37:23Z")

</div>

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](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.
