ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
wsdlclient1.php
Go to the documentation of this file.
1 <?php
2 /*
3  * $Id: wsdlclient1.php,v 1.3 2007/11/06 14:48:48 snichol Exp $
4  *
5  * WSDL client sample.
6  *
7  * Service: WSDL
8  * Payload: document/literal
9  * Transport: http
10  * Authentication: none
11  */
12 require_once('../lib/nusoap.php');
13 $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
14 $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
15 $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
16 $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
17 $client = new nusoap_client('http://www.xignite.com/xquotes.asmx?WSDL', 'wsdl',
19 $err = $client->getError();
20 if ($err) {
21  echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
22 }
23 // Doc/lit parameters get wrapped
24 $param = array('Symbol' => 'IBM');
25 $result = $client->call('GetQuickQuotes', array('parameters' => $param), '', '', false, true);
26 // Check for a fault
27 if ($client->fault) {
28  echo '<h2>Fault</h2><pre>';
29  print_r($result);
30  echo '</pre>';
31 } else {
32  // Check for errors
33  $err = $client->getError();
34  if ($err) {
35  // Display the error
36  echo '<h2>Error</h2><pre>' . $err . '</pre>';
37  } else {
38  // Display the result
39  echo '<h2>Result</h2><pre>';
40  print_r($result);
41  echo '</pre>';
42  }
43 }
44 echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
45 echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
46 echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
47 ?>