[ Index ] |
|
Code source de nusoap 0.7.2 |
1 <?php 2 /* 3 * $Id: wsdlclient5.php,v 1.3 2004/02/23 19:22:19 snichol Exp $ 4 * 5 * WSDL client sample. 6 * 7 * Service: WSDL 8 * Payload: rpc/encoded 9 * Transport: http 10 * Authentication: none 11 */ 12 require_once ('../lib/nusoap.php'); 13 require_once ('../lib/class.wsdlcache.php'); 14 $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : ''; 15 $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : ''; 16 $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : ''; 17 $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : ''; 18 19 $cache = new wsdlcache('.', 60); 20 $wsdl = $cache->get('http://www.xmethods.net/sd/2001/BNQuoteService.wsdl'); 21 if (is_null($wsdl)) { 22 $wsdl = new wsdl('http://www.xmethods.net/sd/2001/BNQuoteService.wsdl', 23 $proxyhost, $proxyport, $proxyusername, $proxypassword); 24 $cache->put($wsdl); 25 } else { 26 $wsdl->debug_str = ''; 27 $wsdl->debug('Retrieved from cache'); 28 } 29 $client = new soapclient($wsdl, true, 30 $proxyhost, $proxyport, $proxyusername, $proxypassword); 31 $err = $client->getError(); 32 if ($err) { 33 echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; 34 } 35 $params = array('isbn' => '0060188782'); 36 $result = $client->call('getPrice', $params); 37 // Check for a fault 38 if ($client->fault) { 39 echo '<h2>Fault</h2><pre>'; 40 print_r($result); 41 echo '</pre>'; 42 } else { 43 // Check for errors 44 $err = $client->getError(); 45 if ($err) { 46 // Display the error 47 echo '<h2>Error</h2><pre>' . $err . '</pre>'; 48 } else { 49 // Display the result 50 echo '<h2>Result</h2><pre>'; 51 print_r($result); 52 echo '</pre>'; 53 } 54 } 55 echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>'; 56 echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>'; 57 echo '<h2>Cache Debug</h2><pre>' . htmlspecialchars($cache->debug_str, ENT_QUOTES) . '</pre>'; 58 echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>'; 59 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Sep 10 13:53:24 2007 | par Balluche grâce à PHPXref 0.7 |