-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzend-ws-client.php
32 lines (25 loc) · 1002 Bytes
/
zend-ws-client.php
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
31
32
<?php
// sample SOAP client using Zend.
$path = dirname(__FILE__);
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'Zend/Loader/StandardAutoloader.php';
$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true));
$loader->register();
$client = new Zend\Soap\Client('http://localhost/mywebservice/zend-ws-server.php?wsdl');
try {
for($i=0; $i<=3; $i++) {
$result1 = $client->randomQuote();
echo 'Calling (' . ($i+1) . ') "randomQuote" returned: ' . $result1 . '<br/>';
}
$result2 = $client->getAge( '05-26-1981' );
echo 'Age of person born on 05-26-1981 is: ' . $result2 . '<br/>';
$result2 = $client->getAge( '1981-05-26' );
echo 'Age of person born on 05-26-1981 is: ' . $result2 . '<br/>';
}
catch( SoapFault $e ) {
echo $e->getMessage();
}
//$request = $client->getLastRequest();
//$response = $client->getLastResponse();
//file_put_contents('zend-ws-access.log', $request.$response, FILE_APPEND);
?>