Ruby xmlrpc call not working

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 = XMLRPC::Client.new2(“http://demo.myslice.info:7080/”)

Authentication token

auth = {“AuthMethod” => “password”, “Username” => “demo”, “AuthString”
=> “demo”}

pp ret.call(“Get”, auth, “slice”, {“slice_hrn” =>
“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 = xmlrpclib.ServerProxy(“http://demo.myslice.info:7080/”,
allow_none=True)

Authentication token

auth = {“AuthMethod”: “password”, “Username”: “demo”, “AuthString”:
“demo”}

print ret = srv.Get(auth, “slice”, [[“slice_hrn”, ‘=’,
“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: [email protected]

Could you post the the error you are receiving from the interpreter as a
Gist?

On Thu, Nov 8, 2012 at 5:25 AM, Mohammed Yasin Rahman

Mohammed Yasin Rahman wrote in post #1083536:

But the same call using python is working:

Since this is not encrypted, using tcpdump or wireshark will show you
what’s being sent “on the wire”, so you can easily see what’s different
in the request.

tcpdump -i eth0 -nn -s1500 -A tcp port 7080