On Sun, 27 Dec 2009 11:46:50 -0800 (PST)
mdipierro <mdipie...@cs.depaul.edu> wrote:
> import xmlrpclib
> server=xmlrpclib.ServerProxy('http://127.0.0.1:8000/app/xmlrpctest/
> call/xmlrpc')
> print str(server.add(3,4)+server.sub(3,4))
> 

I found my mistake. 
The right format for calling is as below:

server=xmlrpclib.ServerProxy('http://localhost/test/xmlrpctest/call/xmlrpc')
print str(server.add(3,4))

Indeed it is also explained at the web2py tutorials but it seems it may cause a 
confusion. It says,

server = ServerProxy('http://..../app/default/call/xmlrpc')

...: The domain name of the application, in my case it was localhost
app: application name
default: the name of your controller
call: the function name that is returning service() function
xmlrpc: use as it is

There is no need to mention the port number as 8000 also.

xmlrpc service calling is working with the same idea as a regular web2py 
application. The idea is simple, just call the funtion of the controller with 
the suitable parameters.

> (assuming the port is 8000).

-- 
Oguz Yarimtepe <oguzyarimt...@gmail.com>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to