dimanche 24 janvier 2016

how to convert the pure soap php to laravel 5

I am new in laravel 5. This code is ok in pure php. But i don't know how to convert this to laravel 5. Can you tell me how to transfer this code to laravel 5.

client.php:

<?php class client {
public function __construct()
{
    $params = array('location' => 'http://localhost:8888/csoap/server.php',
                    'uri' => 'urn://localhost:8888/csoap/server.php');

    /* Initialize webservice */
    $this->instance = new SoapClient(NULL, $params);
}

public function getString($id)
{
    return $this->instance->__soapCall('getOutputString', $id);
}
}

    $client = new client(

);
$id = array('id' => '1');

echo $client->getString($id);
?>

csoap/server.php:

<?php class server {
public function getOutputString($id)
{
    $str = 'Youre ID is ' . $id . '.';
    return $str;
}
}

$params = array('uri' => 'http://localhost:8888/csoap/server.php');
$server =  new SoapServer(NULL, $params);
$server->setClass('server');
$server->handle();

?>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1UlwKhV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire