I want to use XMLRPC to get my API results and show them in XML format in laravel project. I've seen numerous examples for XMLRPC for PHP but can't find any for laravel yet. API i'm using is Wired wubook api: https://tdocs.wubook.net/wired.html
To access the rates of rooms I've generated the permanent token and lcode to run this code in laravel project: fetch_rooms(token, lcode, ancillary=0)
I just don't know the method of XMLRPC through which I can call my wubook api results inside laravel project.
Any help through which I can use XMLRPC in laravel and call my API results in project?
I used the curl method of XML in my PHP code to send XML code to Wubook server. And it worked like a charm.
$xml = "<?xml version='1.0'?>
<methodCall>
Some YOUR XML CODE PARAMS
</methodCall>";
$url = "https://yoururl.com/";
$send_context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-Type: application/xml',
'content' => $xml
)
));
$response = file_get_contents($url, false, $send_context);
$xml1 = simplexml_load_string($response);
$json = json_encode($xml1);
$array = json_decode($json,TRUE);
return response()->json($array);
This way I could be able to send XML code to server and get response in JSON format.