/** * Send a SOAP request to the server * * @param string $method The method name * @param array $param The parameters * @return mixed The server response */ public static function _Call($method, $param) { if (is_null(self::$_Server)) { self::$_Server = new SoapClient(self::$_WsdlUri); } return self::$_Server->__soapCall($method, $param); }
$m->Indoor = false; $m->AgbChecked = true; $m->BookingIP = getenv('REMOTE_ADDR'); $m->TestMode = 'TESTMODE_NODB'; $m->Company = 'dam.Parkservice'; $m->Street = 'Schulzendorfer Str. 10'; $m->ZIP = '12529'; $m->City = 'Hintertux (Oder)'; $m->Comment = 'Dies ist eine Testbuchung. Bitte löschen.'; $m->APIKey = 'TESTMODEREQUEST'; $m->BookingMode = 'booking'; echo "Das folgende Objekt wird an den Webservice geschickt:<br />"; echo "<pre>" . print_r($m, TRUE) . "</pre>"; // call webservice $param = array($m); $mp = meinparkenSoapClient::_Call('Book', $param); echo "Folgende Antwort kommt vom Webservice zurück:<br />"; echo "<pre>" . print_r($mp, true) . "</pre>"; if (!isset($mp->Errors) == true) { $fx = OK; } else { $fx = ER; print_r($mp->Errors); } $bid = $mp->BookingId; if ($bid >= 1) { $fx .= ' ' . OK . ' (#' . print_r($bid, true) . ')'; } else { $fx .= ' ' . ER . ': ' . print_r($bid, true); } echo " {$fx}<br />";