1. Go to this page and download the library: Download paxport/soap-react library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
paxport / soap-react example snippets
$loop = React\EventLoop\Factory::create();
$browser = new Browser($loop);
$wsdl = 'http://example.com/demo.wsdl';
$browser->get($wsdl)->then(function (ResponseInterface $response) use ($browser) {
$client = new Client($browser, (string)$response->getBody());
$api = new Proxy($client);
$api->getBank(array('blz' => '12070000'))->then(function ($result) {
var_dump('Result', $result);
});
});
$loop->run();
$loop = React\EventLoop\Factory::create();
$browser = new Clue\React\Buzz\Browser($loop);
$wsdl = '<?xml …';
$options = array();
$client = new Client($browser, $wsdl, $options);
$browser = new Browser($loop);
$browser->get($url)->then(
function (ResponseInterface $response) use ($browser) {
// WSDL file is ready, create client
$client = new Client($browser, (string)$response->getBody());
// do something…
},
function (Exception $e) {
// an error occured while trying to download the WSDL
}
);
$proxy->myMethod($myArg1, $myArg2)->then(function ($response) {
// result received
});
$proxy->demo()->then(
function ($response) {
// response received for demo function
},
function (Exception $e) {
// an error occured while executing the request
}
});
$promise = $proxy->demo();
$loop->addTimer(2.0, function () use ($promise) {
$promise->cancel();
});
$browser = new Browser($loop);
$browser = $browser->withOptions(array(
'timeout' => 10.0
));
$client = new Client($browser, $wsdl);
$proxy = new Proxy($client);
$proxy->demo()->then(function ($response) {
// response received within 10 seconds maximum
var_dump($response);
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.