# Webservice External XMLRPC

**URL:** <https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638>\
**Category:** Rails\
**Created:** [January 4, 2006, 10:03pm UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638 "2006-01-04T22:03:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [January 4, 2006, 10:03pm UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638/1 "2006-01-04T22:03:40Z")

</div>

Hello i have some trouble getting my webservice to run .  
I have the following webservice :

class DirectSpoolAPI \< ActionWebService::API::Base  
api\_method :add, :expects =\> [{:html=\>:string},{:from=\>:string}],  
:returns =\> [Customer]  
end

class DirectSpoolService \< ActionWebService::Base  
web\_service\_api DirectSpoolAPI  
def add(html,from)  
Customer.find(:first)  
end

def remove  
end  
end

class ApiController \< ApplicationController  
skip\_before\_filter :login\_required

web\_service\_dispatching\_mode :delegated  
web\_service\_scaffold :invoke  
web\_service(:directspool) {DirectSpoolService.new}  
end

The controller behaves fine when accessing it with :  
[http://localhost:3003/api/invoke](http://localhost:3003/api/invoke), and

curl -d ‘\<?xml version="1.0" ?\>Adddsdfsasafdasf’  
[http://localhost:3003/api/directspool](http://localhost:3003/api/directspool)

But when i try to access it with the following script :

require “xmlrpc/client”

server = XMLRPC::Client.new(“10.0.0.132”, “/api/directspool”, 3003)  
begin  
param = server.call(‘add’,:html=\>‘sadfdsaf’,:from=\>‘dsafdsaf’)  
puts “4 + 5 = #{param}”  
rescue XMLRPC::FaultException =\> e  
puts “Error:”  
puts e.faultCode  
puts e.faultString  
end

I get the following error : no such method ‘add’ on API DirectSpoolAPI  
The rails loggins says :

Processing ApiController#directspool (for 10.0.0.1 at 2006-01-04  
22:04:03) [POST]  
Parameters: {“methodName”=\>“add”, “action”=\>“directspool”,  
“params”=\>{“param”=\>{“value”=\>{“struct”=\>{“member”=\>[{“name”=\>“html”,  
“value”=\>{“string”=\>“sadfdsaf”}}, {“name”=\>“from”,  
“value”=\>{“string”=\>“dsafdsaf”}}]}}}}, “controller”=\>“api”}

Web Service Request: add({“html”=\>“sadfdsaf”, “from”=\>“dsafdsaf”})  
Entrypoint: directspool

 \<?xml version="1.0" ?\>addhtmlsadfdsaffromdsafdsaf

ActionWebService::Dispatcher::DispatcherError (no such method ‘add’ on  
API DirectSpoolAPI):

Anybody an idea ?

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [January 4, 2006, 11:02pm UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638/2 "2006-01-04T23:02:03Z")

</div>

Hi!

Interesting. I can’t see any error , I tested in my machine and it’s  
work. Maybe,…if you modify the service try to restart webrick.

Cow

daniel wijnands Ã­rta:

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [January 4, 2006, 11:16pm UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638/3 "2006-01-04T23:16:27Z")

</div>

Hi ,

I have restated fcg and tried webrick.  
Both no luck.

require “xmlrpc/client”

server = XMLRPC::Client.new(“10.0.0.132”, “/api/directspool”, 3003)  
begin  
param = server.call(‘add’,:html=\>‘sadfdsaf’,:from=\>‘dsafdsaf’)  
puts “4 + 5 = #{param}”  
rescue XMLRPC::FaultException =\> e  
puts “Error:”  
puts e.faultCode  
puts e.faultString  
end

gives: no such method ‘add’ on API DirectSpoolAPI

daniel  
=?UTF-8?B?SMOhYmVyIErDoW5vcw==?= wrote:

> Hi!
> 
> Interesting. I can’t see any error , I tested in my machine and it’s  
> work. Maybe,…if you modify the service try to restart webrick.
> 
> Cow
> 
> daniel wijnands Ã­rta:

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [January 5, 2006, 1:00am UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638/4 "2006-01-05T01:00:27Z")

</div>

Hi,

Interesting…  
Here it’s work.  
I dunno why not work. Tomorrow I can try to write a service if you  
publish it, and maybe we can found the solution.

Good Night

Cow

daniel wijnands Ã­rta:

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [January 5, 2006, 8:00am UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638/5 "2006-01-05T08:00:26Z")

</div>

That would be great let me know

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [January 5, 2006, 12:02pm UTC](https://www.ruby-forum.com/t/webservice-external-xmlrpc/51638/6 "2006-01-05T12:02:14Z")

</div>

Okay for the records, the problem is the method call, it should be Add  
🙂  
Got i feel stupid 🙂
