ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
client2.php
Go to the documentation of this file.
1 <?php
2 /*
3  * $Id: client2.php,v 1.4 2007/11/06 14:48:24 snichol Exp $
4  *
5  * Client sample.
6  *
7  * Service: SOAP endpoint
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/onca/soap2", false,
20 $err = $client->getError();
21 if ($err) {
22  echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
23  echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
24  exit();
25 }
26 $client->setUseCurl($useCURL);
27 $client->useHTTPPersistentConnection();
28 $param = array(
29  'manufacturer' => "O'Reilly",
30  'page' => '1',
31  'mode' => 'books',
32  'tag' => 'trachtenberg-20',
33  'type' => 'lite',
34  'devtag' => 'Your tag here'
35 );
36 $params = array('ManufacturerSearchRequest' =>
37  new soapval('ManufacturerSearchRequest',
38  'ManufacturerRequest',
39  $param,
40  false,
41  'http://soap.amazon.com')
42  );
43 $result = $client->call('ManufacturerSearchRequest', $params, 'http://soap.amazon.com', 'http://soap.amazon.com');
44 if ($client->fault) {
45  echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';
46 } else {
47  $err = $client->getError();
48  if ($err) {
49  echo '<h2>Error</h2><pre>' . $err . '</pre>';
50  } else {
51  echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
52  }
53 }
54 echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
55 echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
56 echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
57 ?>