How can I use php xmlrpc in the shopware plugin to send data from shopware to odoo end.

I’ve tried the code in my custom shopware 6 plugin but it says  “Uncaught Error: Class ‘Webkul\Swerpsync\Controller\Api\xmlrpc_client’ not found”.

I’ve attached the full response and the code as well.

namespace Webkul\Swerpsync\Controller\Api;

require “”;

public function testConnection($configValues)


file_put_contents( __DIR__ ."/test.txt", “inside test connection method\n”);

file_put_contents( __DIR__ ."/test.txt", __DIR__."/\n");


$url = “”;

$port = “8003”;

$db = “wc”;

$user = “admin”;

$pwd = “webkul”;

file_put_contents( __DIR__ ."/test.txt", “before response from server.\n”, FILE_APPEND);

$sock = new xmlrpc_client($url.":".$port."/xmlrpc/common");

$client = new xmlrpc_client($url.":".$port."/xmlrpc/object");

$msg = new xmlrpcmsg(‘login’);

$msg->addParam(new xmlrpcval($db, ‘string’));

$msg->addParam(new xmlrpcval($user, ‘string’));

$msg->addParam(new xmlrpcval($pwd, ‘string’));

$resp = $sock->send($msg);

file_put_contents( __DIR__ ."/test.txt", “after response from server.\n”, FILE_APPEND);

if (!$resp->faultCode()){

$userId = $resp->value()->scalarval();


return $configValues;

my hottest guess is that you dont have the xmlrpc package for php installed on your server


and all i am reading about xmlrpc on the internet is, that you shouldn’t use it due to security issues