ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
wsdlclient2.php
Go to the documentation of this file.
1 <?php
2 /*
3  * $Id: wsdlclient2.php,v 1.3 2007/11/06 14:48:49 snichol Exp $
4  *
5  * WSDL client sample.
6  *
7  * Service: WSDL proxy
8  * Payload: rpc/encoded
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 $useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
18 $client = new nusoap_client("http://soap.amazon.com/schemas2/AmazonWebServices.wsdl", 'wsdl',
20 $err = $client->getError();
21 if ($err) {
22  echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
23  exit();
24 }
25 $client->setUseCurl($useCURL);
26 $proxy = $client->getProxy();
27 $param = array(
28  'browse_node' => 18,
29  'page' => 1,
30  'mode' => 'books',
31  'tag' =>'melonfire-20',
32  'type' => 'lite',
33  'devtag' => 'Your dev tag'
34 );
35 $result = $proxy->BrowseNodeSearchRequest($param);
36 // Check for a fault
37 if ($proxy->fault) {
38  echo '<h2>Fault</h2><pre>';
39  print_r($result);
40  echo '</pre>';
41 } else {
42  // Check for errors
43  $err = $proxy->getError();
44  if ($err) {
45  // Display the error
46  echo '<h2>Error</h2><pre>' . $err . '</pre>';
47  } else {
48  // Display the result
49  echo '<h2>Result</h2><pre>';
50  print_r($result);
51  echo '</pre>';
52  }
53 }
54 echo '<h2>Request</h2><pre>' . htmlspecialchars($proxy->request, ENT_QUOTES) . '</pre>';
55 echo '<h2>Response</h2><pre>' . htmlspecialchars($proxy->response, ENT_QUOTES) . '</pre>';
56 echo '<h2>Client Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
57 echo '<h2>Proxy Debug</h2><pre>' . htmlspecialchars($proxy->debug_str, ENT_QUOTES) . '</pre>';
58 ?>