// This uses the NuSOAP library // Client Script // Pull in the NuSOAP code require_once('lib/nusoap.php'); // Create the client instance $client = new soap_client('http://hostname/server-scripts/soap-server.php?wsdl', true); $NAMESPACE = 'urn:Virtuozzo'; // Check for an error $err = $client->getError(); if ($err) { // Display the error echo '
Constructor error: ' . $err . '
'; // At this point, you know the call that follows will fail } // Call the SOAP method $result = $client->call( 'vzctl', // method name array('set', '300', '--hostname VZSOAP.changed.internal --save'), // input parameters 'uri:Virtuozzo', // namespace 'uri:Virtuozzo/vzctl' // SOAPAction ); // Check for a fault if ($client->fault) { echo 'Fault: '; print_r($result); echo '
'; } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo 'Error: ' . $err . '
'; } else { // Display the result print_r($result); echo "