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