Marius Cramer
2014-02-18 8ddcb0d7ac2141b934c789cd7b5cf06f05e730b0
remoting_client/examples/mail_catchall_add.php
@@ -1,38 +1,38 @@
<?php
require('soap_config.php');
require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location,
                                     'uri'      => $soap_uri,
                            'trace' => 1,
                            'exceptions' => 1));
      'uri'      => $soap_uri,
      'trace' => 1,
      'exceptions' => 1));
try {
   if($session_id = $client->login($username,$password)) {
   if($session_id = $client->login($username, $password)) {
      echo 'Logged successfull. Session ID:'.$session_id.'<br />';
   }
   //* Set the function parameters.
   $client_id = 1;
   $params = array(
         'server_id' => 1,
         'source' => '@test.int',
         'destination' => 'ciao@test.int',
         'type' => 'catchall',
         'active' => 'y'
         );
      'server_id' => 1,
      'source' => '@test.int',
      'destination' => 'ciao@test.int',
      'type' => 'catchall',
      'active' => 'y'
   );
   $affected_rows = $client->mail_catchall_add($session_id, $client_id, $params);
   echo "Catchall ID: ".$affected_rows."<br>";
   if($client->logout($session_id)) {
      echo 'Logged out.<br />';
   }
} catch (SoapFault $e) {
   echo $client->__getLastResponse();
   die('SOAP Error: '.$e->getMessage());