forked from clue/reactphp-soap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01-client-blz-wsdl.php
More file actions
30 lines (23 loc) · 828 Bytes
/
Copy path01-client-blz-wsdl.php
File metadata and controls
30 lines (23 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Clue\React\Buzz\Browser;
use Clue\React\Soap\Client;
use Clue\React\Soap\Proxy;
use Psr\Http\Message\ResponseInterface;
require __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$browser = new Browser($loop);
$blz = isset($argv[1]) ? $argv[1] : '12070000';
$browser->get('http://www.thomas-bayer.com/axis2/services/BLZService?wsdl')->done(function (ResponseInterface $response) use ($browser, $blz) {
$client = new Client($browser, (string)$response->getBody());
$api = new Proxy($client);
$api->getBank(array('blz' => $blz))->then(
function ($result) {
echo 'SUCCESS!' . PHP_EOL;
var_dump($result);
},
function (Exception $e) {
echo 'ERROR: ' . $e->getMessage() . PHP_EOL;
}
);
});
$loop->run();