From: Mohammed Yasin Rahman Date: 2012-11-08T19:25:59+09:00 Subject: ruby xmlrpc call not working --Apple-Mail=_B010062D-0796-42F3-BE4E-A6A89959BB8A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I wrote this code in ruby for calling remote API using xmlrpc/client in = ruby, but it's not working: require "xmlrpc/client" require "pp" XMLRPC::Config.module_eval do remove_const :ENABLE_NIL_PARSER const_set :ENABLE_NIL_PARSER, true end ret =3D XMLRPC::Client.new2("http://demo.myslice.info:7080/") # Authentication token auth =3D {"AuthMethod" =3D> "password", "Username" =3D> "demo", = "AuthString" =3D> "demo"} pp ret.call("Get", auth, "slice", {"slice_hrn" =3D> = "ple.upmc.myslicedemo"}, ["slice_hrn", "slice_description", = "resources.network", "resources.type", "resources.hrn", = "resources.hostname"]) But the same call using python is working: #!/usr/bin/env python # -*- coding: utf-8 -*- # Connection to XMLRPC server import xmlrpclib srv =3D xmlrpclib.ServerProxy("http://demo.myslice.info:7080/", = allow_none=3DTrue) # Authentication token auth =3D {"AuthMethod": "password", "Username": "demo", "AuthString": = "demo"} print ret =3D srv.Get(auth, "slice", [["slice_hrn", '=3D', = "ple.upmc.myslicedemo"]], {}, ["slice_hrn", "resource.network", = "resource.type", "resource.hrn", "resource.hostname"]) I tried many places, nobody could give me any solution. Please help me. ----- Best Regards, Mohammed Yasin Rahman Software Engineer UPMC, CNRS Paris, France Email: mohammed-yasin.rahman@lip6.fr --Apple-Mail=_B010062D-0796-42F3-BE4E-A6A89959BB8A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = wrote this code in ruby for calling remote API using xmlrpc/client in = ruby, but it's not = working:


require = "xmlrpc/client"
require = "pp"

XMLRPC::Config.module_eval = do
  remove_const :ENABLE_NIL_PARSER
  = const_set :ENABLE_NIL_PARSER, = true
end


ret =3D = XMLRPC::Client.new2("http://demo.myslice.info:7080/= ")


# Authentication = token
auth =3D {"AuthMethod" =3D> "password", "Username" = =3D> "demo", "AuthString" =3D> "demo"}

pp = ret.call("Get", auth, "slice",  {"slice_hrn" =3D> = "ple.upmc.myslicedemo"}, ["slice_hrn", "slice_description", = "resources.network", "resources.type", "resources.hrn", = "resources.hostname"])


But the = same call using python is = working:

#!/usr/bin/env python
# = -*- coding: utf-8 -*-

# Connection to XMLRPC = server
import xmlrpclib
srv =3D = xmlrpclib.ServerProxy("http://demo.myslice.info:7080/= ", allow_none=3DTrue)

# Authentication = token
auth =3D {"AuthMethod": "password", "Username": "demo", = "AuthString": "demo"}

print ret =3D = srv.Get(auth, "slice", [["slice_hrn", '=3D', "ple.upmc.myslicedemo"]], = {}, ["slice_hrn",  "resource.network", "resource.type", = "resource.hrn", = "resource.hostname"])


I tried = many places, nobody could give me any solution. Please help = me.





=
-----
Best Regards,

Mohammed Yasin Rahman
Software = Engineer
UPMC, CNRS
Paris, France

= --Apple-Mail=_B010062D-0796-42F3-BE4E-A6A89959BB8A--