Example #1
1
 private function soapCall($function, $input)
 {
     $result = $this->soapClient->__soapCall($function, [$input], null, $this->securityHeader);
     if (!@$result->Resultaat->Succesvol) {
         throw new ClientException(@$result->Resultaat->Omschrijving ?: 'An unknown error occurred');
     }
     return $result;
 }
/**
 *
 * @param array $param
 *        	<br>Parámetros de entrada.
 * @return array
 */
function calculoAportacionCiudadano($param)
{
    global $respError, $farmacia;
    $param = objectToArray($param);
    //die(print_r($param));
    if ($farmacia == FARMACIA_DEBUG or strlen(FARMACIA_DEBUG) == 0) {
        if (DEBUG & DEBUG_LOG) {
            $mensaje = print_r($param, TRUE);
            $mensaje .= "--Llamada hecha en el fichero: " . __FILE__ . ", en la línea: " . __LINE__;
            error_log("[" . date("c") . "] \r\n {$mensaje}", 3, DIRECTORIO_LOG . __FUNCTION__ . "_" . date("YmdH") . ".log");
        }
    }
    unset($param["farmacia"]);
    unset($param["DNI"]);
    $client = new SoapClient(END_POINT, array("location" => LOCATION, "trace" => true, "exceptions" => false));
    $result = $client->__soapCall(__FUNCTION__, array($param));
    //die(print_r($result));
    if (is_soap_fault($result)) {
        if ($farmacia == FARMACIA_DEBUG or strlen(FARMACIA_DEBUG) == 0) {
            if (DEBUG & DEBUG_LOG) {
                $mensaje = "REQUEST:\n" . $client->__getLastRequest() . "\n";
                $mensaje .= "RESPONSE:\n" . $client->__getLastResponse() . "\n";
                $mensaje .= "RESULT:\n" . $result . "\n";
                $mensaje .= "--SOAP FAULT, llamada hecha en el fichero: " . __FILE__ . ", en la línea: " . __LINE__ . "\n";
                error_log("[" . date("c") . "] \r\n {$mensaje}", 3, DIRECTORIO_LOG . __FUNCTION__ . "_" . date("YmdH") . ".log");
            }
        }
        return array(__FUNCTION__ . "Result" => array("return" => $result->return, "resultadoOperacion" => array("codigoResultadoOperacion" => -9000, "mensajeResultadoOperacion" => $result->faultstring)));
    }
    return array(__FUNCTION__ . "Result" => array("return" => $result->return, "resultadoOperacion" => $respError->sinErrores()));
}
Example #3
0
 /**
  * Function synthesizing a text 
  * Returned variable is an url of the file
  *
  * @param string $text UTF-8 encoded string to synthesize 
  * @return string URL address for speech file synthesized from $text parameter, or false in case of error
  */
 public function synthesize($text, $text_type)
 {
     error_log("Synthesizing Test: " . $text);
     // the configuration (could be moved to constants section of the website)
     // wsdl URL
     $wsdl = 'http://www.ivona.com/saasapiwsdl.php';
     // soap client initialization (it requires soap client php extension available)
     $Binding = new SoapClient($wsdl, array('exceptions' => 0));
     // getToken for the next operation
     $input = array('user' => USER);
     $token = $Binding->__soapCall('getToken', $input);
     if (is_soap_fault($token)) {
         error_log('API call: getToken error: ' . print_r($token, 1));
         return false;
     }
     // additional parameters
     $params = array();
     //$params[]=array('key'=>'Prosody-Rate', 'value'=>PROSODY_RATE); // example value for the new text speed
     // createSpeechFile (store text in IVONA.com system, invoke synthesis and get the link for the file)
     $input = array('token' => $token, 'md5' => md5(md5(PASSWORD) . $token), 'text' => $text, 'contentType' => $text_type, 'voiceId' => SELECTED_VOICE, 'codecId' => 'mp3/22050', 'params' => $params);
     $fileData = $Binding->__soapCall('createSpeechFile', $input);
     if (is_soap_fault($fileData)) {
         error_log('API call: createSpeechFile error: ' . print_r($fileData, 1));
         return false;
     }
     // return the sound file url
     return $fileData['soundUrl'];
 }
Example #4
0
function posteazaAnunt($inchiriere = 0)
{
    global $oferta;
    global $apartament;
    global $client;
    global $agent;
    global $subzona;
    global $fotografii;
    $id = $oferta->id;
    if ($inchiriere) {
        $id += 90000;
    }
    $ofertaxml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
	<oferta tip="apartament" versiune="2">
	<id2>' . $id . '</id2>
	<adresa>' . '' . '</adresa>
	<longitudine>' . $apartament->Lng . '</longitudine>
	<latitudine>' . $apartament->Lat . '</latitudine>
	<altitudine>200</altitudine>
	
	
	</oferta>';
    $s = new SoapClient(API_URI);
    // login
    echo "Login<br/>";
    try {
        $result = $s->__soapCall('login', array('login' => array('id' => 'X36V', 'hid' => '89cn23489fn32r', 'server' => '', 'agent' => '', 'parola' => '')));
    } catch (Exception $e) {
        die('Eroare Login: '******'#', $result->extra);
    // id-ul de sesiune va fi folosit ulterior la orice request
    $session_id = $extra[1];
    echo '<pre>LOGIN: '******'</pre>';
    // publica oferta
    echo "Publica<br/>";
    if ($oferta->ExportImobiliare < 3 && $oferta->Stare == 'de actualitate') {
        if ($oferta->ExportImobiliare = 1) {
            $operatie = "MOD";
        } else {
            $operatie = "ADD";
        }
    } else {
        $operatie = "DEL";
    }
    try {
        $result = $s->__soapCall('publica_oferta', array('publica_oferta' => array('id_str' => '0:' . $id2random, 'sid' => $session_id, 'operatie' => $operatie, 'ofertaxml' => $ofertaxml)));
    } catch (Exception $e) {
        die('Eroare Publicare oferta: ' . $e->getMessage());
    }
    echo '<pre>PUBLICARE OFERTA: ' . print_r($result, true) . '</pre>';
    // logout
    try {
        $result = $s->__soapCall('logout', array('logout' => array('sid' => $session_id, 'id' => '', 'jurnal' => '')));
    } catch (Exception $e) {
        die('Eroare Logout: ' . $e->getMessage());
    }
    echo '<pre>LOGOUT: ' . print_r($result, true) . '</pre>';
}
 /**
  * @param string $method
  * @param mixed $data
  * @param array $options
  * @param null $inputHeaders
  * @param null $outputHeaders
  *
  * @throws Exception\ClientException
  * @return mixed
  */
 public function call($method, $data, $options = array(), $inputHeaders = null, &$outputHeaders = null)
 {
     if (!$this->client) {
         $this->initializeClient();
     }
     try {
         return $this->client->__soapCall($method, $data, $options, $inputHeaders, $outputHeaders);
     } catch (\SoapFault $soapFault) {
         throw new ClientException(sprintf('Call to %s failed', $method), 0, $soapFault);
     }
 }
 /**
  * Execute the requested call
  * 
  * @param   string $service     The name of the service to execute
  * @param   array  $parameters  All parameter in an assiociative array
  * @return  type
  * @throws  Exception
  */
 public function execute($service, $parameters)
 {
     // make sure a SOAP client exists
     if (is_null($this->soapClient)) {
         $this->createSoapClient();
     }
     // create a request object (an stdClass) from the parameters array
     $request = (object) $parameters;
     // add authentication to the request object
     $request->header = $this->getRequestHeader();
     // execute the call
     $response = $this->soapClient->__soapCall($service, array($request));
     // return the response
     return $response;
 }
Example #7
0
 /**
  * method to call didww api 2 soap method
  * @param string $method
  * @param array $arguments
  * @return mixed
  * @throws ApiClientException
  */
 public function call($method, $arguments = array())
 {
     $arguments = array_merge(array('auth_string' => self::getCredentials()->getAuthString()), $arguments);
     $method = 'didww_' . $method;
     $timeStart = microtime(true);
     try {
         $result = $this->_client->__soapCall($method, $arguments);
     } catch (\Exception $e) {
         if (self::$_debug) {
             $this->debug("raw request", $this->_client->__getLastRequest());
             $this->debug("raw response", $this->_client->__getLastResponse());
         }
         throw $e;
     }
     if (self::$_debug) {
         $this->debug("raw request", $this->_client->__getLastRequest());
         $this->debug("raw response", $this->_client->__getLastResponse());
     }
     /**
      * check if api returned error and throw exception
      */
     if (isset($result->error) && $result->error > 0) {
         $message = isset(self::$_errorCodes[$result->error]) ? self::$_errorCodes[$result->error] : 'Unknown error with code : ' . $result->error;
         throw new ApiClientException($message);
     }
     $timeFinish = microtime(true);
     $this->time = $timeFinish - $timeStart;
     if (self::$_debug) {
         $this->debug("response from {$method}:", $result);
     }
     return (array) $result;
 }
Example #8
0
 /**
  * Query the SOAP server with the given method and parameters
  *
  * @return mixed Returns the result on success, false on failure
  */
 public function query()
 {
     $this->error = false;
     if (!$this->connected) {
         return false;
     }
     $args = func_get_args();
     $method = null;
     $queryData = null;
     if (count($args) === 2) {
         $method = $args[0];
         $queryData = $args[1];
     } elseif (count($args) > 2 && !empty($args[1])) {
         $method = $args[0];
         $queryData = $args[1][0];
     } else {
         return false;
     }
     try {
         $result = $this->client->__soapCall($method, $queryData);
     } catch (SoapFault $fault) {
         $this->error = $fault->faultstring;
         $this->showError();
         return false;
     }
     return $result;
 }
Example #9
0
 protected function _doCharge()
 {
     $data = array('merchantCode' => trim($this->user_api), 'cardcode' => $this->Encrypt($this->pass_api, $this->pin), 'cardserial' => trim($this->seri), 'cardtype' => $this->_array_card[$this->card_type], 'target' => $this->user["ch_public_id"], "signkey" => $this->Encrypt($this->pass_api, $this->_array_card[$this->card_type] . $this->pin . $this->user_api . $this->pass_api));
     $soap_client = new \SoapClient(null, array('location' => "http://172.16.10.10/ver2.0/?r=cardcharging&ws=1", 'uri' => "localhost", 'connection_timeout' => 120, 'encoding' => 'utf-8', 'trace' => 1, 'exceptions' => 0));
     $result = $soap_client->__soapCall("CardChargingController.UseCard", array("cardrequest" => json_encode($data)));
     //        if ($this->user["ch_public_id"] == "f23741423013342")
     //        {
     //            print_r($result);
     //            die;
     //        }
     $result = json_decode($result);
     if (!empty($result)) {
         $this->msg = $result->retMsg;
         $this->info_card = $result->data_cardValue;
     } else {
         $this->msg = "Hệ Thống Đang Bận Vui Lòng thử lại sau vài giây bạn nhé !!!";
         $this->info_card = 0;
     }
     if (!empty($result->data_transId)) {
         $this->transaction = $result->data_transId;
     }
     if (intval($this->info_card) >= 10000) {
         $response = array("status" => 1, "message" => "Bạn đã nạp : " . $this->info_card . " VNĐ. Vào tài khoản : " . $this->user["ch_nickname"], "partner_transaction" => $this->transaction, "value" => $this->info_card, "promotion" => $this->_promotion[$this->card_type]);
     } else {
         $response = array("status" => 0, "message" => $this->msg, "partner_transaction" => $this->transaction, "value" => 0, "promotion" => 0);
     }
     return $response;
 }
Example #10
0
 public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
 {
     $started = microtime(true);
     $this->_data = array_merge($this->_data, ['function_name' => $function_name, 'arguments' => $arguments, 'function_options' => $options, 'input_headers' => $input_headers, 'start_time' => date('Y-m-d H:i:s')]);
     try {
         $result = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
         $this->_data['duration'] = microtime(true) - $started;
         if ($output_headers) {
             $this->_data['output_headers'] = (array) $output_headers;
         }
         if (is_soap_fault($result)) {
             // Cover non-exception variant
             return $this->logSoapFault($result);
         }
         $this->_data['result_object'] = $result;
         $this->finalize();
         return $result;
     } catch (\Exception $error) {
         $this->_data['duration'] = microtime(true) - $started;
         if ($output_headers) {
             $this->_data['output_headers'] = (array) $output_headers;
         }
         $this->logSoapFault($error);
         throw $error;
     }
 }
Example #11
0
 private function testEnv(array $functions, $url, OutputInterface $output)
 {
     $soapClient = new \SoapClient($url, array('cache_wsdl' => 0, 'trace' => 1, 'soap_version' => SOAP_1_1));
     foreach ($functions as $function => $parameters) {
         $output->writeln('Test de la fonction soap <comment>' . $function . '</comment>');
         $output->writeln('Parameters : ');
         dump($parameters);
         if (!array_key_exists('methodCall', $this->config) || $this->config['methodCall'] == 'soapCall') {
             $result = $soapClient->__soapCall($function, $parameters);
         } else {
             $result = $soapClient->{$function}($parameters);
         }
         $headers = $soapClient->__getLastResponseHeaders();
         if ($output->isDebug()) {
             $output->writeln('Entete de la reponse : ');
             dump($headers);
         }
         if (false === ($site = $this->getSiteHeader($headers))) {
             throw new \Exception('Site Header introuvable dans la réponse.', 1);
         }
         $output->writeln('Serveur ayant repondu : <info>' . $site . '</info>');
         $output->writeln('Reponse : ');
         dump($result);
         if ($output->isDebug()) {
             dump($soapClient->__getLastResponse());
         }
     }
 }
 /**
  * Call php soap
  *
  * @param	unknown_type		$func
  * @param	unknown_type		$param
  * @return	unknown
  */
 function callPhpSOAP($func, $param)
 {
     $header = null;
     if ($this->options['authentication'] == 'headers') {
         if ($this->reactid) {
             $header = new SoapHeader('', 'HeaderAuthenticate', (object) array('reactid' => $this->reactid), 1);
         } elseif ($this->username && $this->password) {
             $header = new SoapHeader('', 'HeaderLogin', (object) array('username' => $this->username, 'password' => $this->password), 1);
             $this->password = false;
         }
     }
     /*return array(
     			'username' => $this->username,
     			'password' => $this->password,
      		'func' => $func
     		); */
     $result = $this->client->__soapCall($func, $param, NULL, $header);
     if (is_soap_fault($result)) {
         $this->error = $result;
         return false;
     }
     if (is_a($this->client->headersIn['HeaderAuthenticate'], 'stdClass')) {
         $this->reactid = $this->client->headersIn['HeaderAuthenticate']->reactid;
     }
     return $this->options['format'] == 'object' ? $result : $this->object2array($result);
 }
Example #13
0
 public function __soapCall($function_name, $arguments, $options = array(), $input_headers = null, &$output_headers = null)
 {
     $result = parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
     $log = new jLogSoapMessage($function_name, $this, 'soap');
     jLog::log($log, 'soap');
     return $result;
 }
Example #14
0
 public function sendTaskMsg($projectID = 0, $taskID = 0, $oldAssignedTo = null, $isFromCreate)
 {
     #return;
     if ($isFromCreate) {
         $assignedTo = current($_POST['assignedTo']);
     } else {
         $assignedTo = $_POST['assignedTo'];
     }
     $realname = $this->dao->select('realname')->from(TABLE_USER)->where('account')->eq($assignedTo)->fetch('realname');
     $msg = "{$realname},您被指派了任务,信息链接:   " . 'http://' . $_SERVER['HTTP_HOST'] . '/zentao/sprint-taskview-' . "{$taskID}.html";
     $fastMsg = $this->dao->select('fastMsg')->from(TABLE_USER)->where('account')->eq($assignedTo)->fetch('fastMsg');
     try {
         $client = new SoapClient("http://99.48.237.125:5880/openapi/openapi.php?wsdl");
         $parm1 = '5DEDD10D2E434A139A05953BDB66CC68';
         $parm2 = '600000';
         $parm3 = $fastMsg;
         $parm4 = $msg;
         $param = array('key' => $parm1, 'from' => $parm2, 'sendto' => $parm3, 'content' => $parm4);
         if ($oldAssignedTo != $assignedTo) {
             $arr = $client->__soapCall('SendMessage', $param);
         }
     } catch (SOAPFault $e) {
         print $e;
     }
 }
Example #15
0
 public function receiveResponseXML($ticket, $response, $hresult, $message)
 {
     $req = new QuickBooks_Request_ReceiveResponseXML($ticket, $response, $hresult, $message);
     $resp = parent::__soapCall('receiveResponseXML', array($req));
     $tmp = current($resp);
     return $tmp;
 }
Example #16
0
 public function sentMT($serviceNumber, $receiver, $msgType, $content, $charge, $description, $smsId, $senderPhone)
 {
     $receiver = Formatter::formatPhone($receiver);
     $content = Common::strNormal($content);
     $description = Common::strNormal($description);
     $ret = "";
     $serviceNumber = Yii::app()->params['smsClient']['serviceNumber'];
     if (!isset($senderPhone) || !$senderPhone) {
         $senderPhone = Yii::app()->params['smsClient']['serviceNumber'];
     }
     try {
         $timeOut = 600;
         // connection timeout in seconds
         @ini_set('default_socket_timeout', $timeOut);
         Yii::log("Before call soap smsServer", "trace");
         $params = array('username' => $this->username, 'password' => $this->password, 'service_number' => $serviceNumber, 'sender' => 'amusic', 'receiver' => $receiver, 'content' => $content, 'charge' => $charge, 'msg_type' => $msgType, 'subject' => $description, 'sms_id' => $smsId, 'smsc' => $serviceNumber, 'priority' => 3);
         Yii::log(json_encode($params), "info");
         $localMode = isset(Yii::app()->params['local_mode']) ? Yii::app()->params['local_mode'] : 0;
         if (!$localMode) {
             $client = new SoapClient($this->smsWsdl);
             $ret = $client->__soapCall('sendMT', $params);
         }
         //$ret->return = "0|Success";
         $this->sentLogging($ret, $serviceNumber, $receiver, $msgType, $content, $charge, $description, $smsId);
     } catch (Exception $e) {
         Yii::log("Exception on call soap smsServer", "trace");
         $ret = "999|Exception|" . $e->getMessage();
     }
     return $ret;
 }
Example #17
0
 public function findReservation($debut, $fin)
 {
     $configResaBooking = $this->em->find('BackResaBookingBundle:Configuration', 1);
     $client = new \SoapClient($configResaBooking->getWsdl());
     $request = array($configResaBooking->getLogin(), $configResaBooking->getPassword(), $debut, $fin);
     return $client->__soapCall('findreservation', $request);
 }
Example #18
0
 public static function GetRegZavod()
 {
     $debug = false;
     $wsdl_url = dirname(__FILE__) . '/RegZavodServicePort.wsdl';
     if (!file_exists($wsdl_url)) {
         echo 'Missing WSDL shema for RegZavodServicePort.wsdl', "\n";
         echo 'WSDL PATH: ', $wsdl_url, "\n";
         die;
     }
     $client = new SoapClient($wsdl_url, array('exceptions' => 0, 'trace' => 1, 'user_agent' => 'Bober'));
     $result = $client->__soapCall('getRegZavod', array());
     if ($debug) {
         var_dump($client->__getFunctions());
         echo 'REQUEST HEADERS:', "\n", $client->__getLastRequestHeaders(), "\n";
         echo 'REQUEST:', "\n", $client->__getLastRequest(), "\n";
         var_dump($result);
         if (is_soap_fault($result)) {
             trigger_error('SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})', E_USER_ERROR);
         }
         print_r($result);
     }
     if ($result != '' && !is_soap_fault($result)) {
         $result = json_decode(json_encode($result), true);
         return $result;
     } else {
         return array();
     }
 }
Example #19
0
File: soap.php Project: fg-ok/codev
 public static function soapRequest($args)
 {
     // get SOAP function name to call
     if (!isset($args['action'])) {
         die("No action specified.");
     }
     $function_name = $args['action'];
     // remove function name from arguments
     unset($args['action']);
     // prepend username/passwords to arguments
     $args = array_merge(self::$conf, $args);
     // connect and do the SOAP call
     try {
         $client = new SoapClient(self::$mantisConnectUrl . '?wsdl');
         $result = $client->__soapCall($function_name, $args);
         echo "URL : " . self::$mantisConnectUrl . '?wsdl' . "<br>";
         echo "Method : " . $function_name . "<br>";
         echo "Args : " . "<br>";
         var_dump($args);
         echo "<br>";
     } catch (SoapFault $e) {
         self::$logger->error("Error with Mantis SOAP", $e);
         $result = array('error' => $e->faultstring);
     }
     return $result;
 }
Example #20
0
 public function info($tag)
 {
     $args = array('guid' => '11111111-1111-1111-1111-111111111111', 'applicationName' => 'GLPI', 'serviceTags' => $tag);
     $response = parent::__soapCall('GetAssetInformation', array($args));
     if (is_soap_fault($response) || !isset($response->GetAssetInformationResult)) {
         return false;
     }
     $ship_time = strtotime($response->GetAssetInformationResult->Asset->AssetHeaderData->SystemShipDate);
     $info['ShipDate'] = date("Y-m-d", $ship_time);
     $warranty_end_date = "";
     $warranty_days_remaining = -1;
     if (isset($response->GetAssetInformationResult->Asset->Entitlements) && isset($response->GetAssetInformationResult->Asset->Entitlements->EntitlementData)) {
         $entitlement_data = $response->GetAssetInformationResult->Asset->Entitlements->EntitlementData;
         $entitlement_data = is_array($entitlement_data) ? $entitlement_data : array($entitlement_data);
         foreach ($entitlement_data as $data) {
             $temp_days = $data->DaysLeft;
             if ($temp_days > $warranty_days_remaining) {
                 $warranty_days_remaining = $temp_days;
                 $warranty_end_date = date('Y-m-d', strtotime($data->EndDate));
             }
             //end if
         }
         //end foreach
     }
     //end if
     if ($warranty_end_date != "") {
         $info['WarrantyEndDate'] = $warranty_end_date;
     }
     //end if
     if ($warranty_days_remaining > -1) {
         $info['WarrantyDaysRemaining'] = $warranty_days_remaining;
     }
     //end if
     return $info;
 }
Example #21
0
/**
* Make a call to a SoapClient
*
* @param SoapClient $connection  The SoapClient to call
* @param string $call            Operation to be performed by client
* @param array $params           Parameters for the call
* @return mixed                  The return parameters of the operation or a SoapFault
*                                If the operation returned several parameters then these
*                                are returned as an object rather than an array
*/
function soap_call($connection, $call, $params)
{
    try {
        $return = $connection->__soapCall($call, $params);
    } catch (SoapFault $f) {
        $return = $f;
    } catch (Exception $e) {
        $return = new SoapFault('client', 'Could call the method');
    }
    // return multiple parameters using an object rather than an array
    if (is_array($return)) {
        $keys = array_keys($return);
        $assoc = true;
        foreach ($keys as $key) {
            if (!is_string($key)) {
                $assoc = false;
                break;
            }
        }
        if ($assoc) {
            $return = (object) $return;
        }
    }
    return $return;
}
Example #22
0
 public function sumar($x, $y)
 {
     $client = new SoapClient("http://localhost/NetBeansProjects/INFO/LAB_WS/ws/Soap/SoapOperation.php?wsdl", array('trace' => true, 'cache_wsdl' => WSDL_CACHE_NONE, 'location' => 'http://localhost/NetBeansProjects/INFO/LAB_WS/WS/Soap/SoapOperation.php'));
     $xml = "<sumar><x>{$x}</x><y>{$y}</y></sumar>";
     $result = $client->__soapCall("sumar", array($x, $y));
     return $result;
 }
Example #23
0
 /**
  * Magiczne wywowałanie metody $this->SoapClient->ClassName($args)
  * Opakowane jest przez try-catch, więc od razu obsłużone są wyjątki i zwracany response.
  *
  * Przykład:
  *  $this->authorize($param1, $param2, $param3);
  *  $this->sendRegistries($registries);
  * powoduje uruchomienie:
  *  $this->soapClient->authorize($param1, $param2, $param3);
  *  $this->soapClient->sendRegistries($registries);
  *
  * @param $name
  * @param $arguments
  *
  * @return mixed
  * @throws MK_Exception
  */
 public function __call($name, $arguments)
 {
     if ($this->soapClient instanceof SoapClient) {
         try {
             $response = $this->soapClient->__soapCall($name, $arguments);
             if ($this->debugRequest) {
                 echo $this->debugRow('Last request', $this->soapClient->__getLastRequest());
             }
             if ($this->debugResponse) {
                 echo $this->debugRow('Last response', $this->soapClient->__getLastResponse());
             }
             return $response;
         } catch (SoapFault $e) {
             $debug = $this->debugRequest ? $this->debugRow('Last request', $this->soapClient->__getLastRequest()) : '';
             $debug .= $this->debugResponse ? $this->debugRow('Last response', $this->soapClient->__getLastResponse()) : '';
             throw new MK_Exception($debug . $this->debugRow('SoapFault', $e->getMessage()));
         } catch (Exception $e) {
             $debug = $this->debugRequest ? $this->debugRow('Last request', $this->soapClient->__getLastRequest()) : '';
             $debug .= $this->debugResponse ? $this->debugRow('Last response', $this->soapClient->__getLastResponse()) : '';
             throw new MK_Exception($debug . $this->debugRow('Exception', $e->getMessage()));
         }
     } else {
         throw new MK_Exception('Nie zostało nawiązane połączenie z Brokerem!');
     }
 }
Example #24
0
 public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
 {
     $header[] = new \SoapHeader('http://www.w3.org/2005/08/addressing', 'To', $this->location, 0);
     $header[] = new \SoapHeader('http://www.w3.org/2005/08/addressing', 'Action', $this->getAction($function_name), 0);
     $this->__setSoapHeaders(null);
     $this->__setSoapHeaders($header);
     return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
 }
Example #25
0
 function EliminarEmisor($rfc)
 {
     $client = new SoapClient($this->url);
     $params = array("broker" => "KOSMOSSP", "rfc" => (string) $rfc);
     $xml = array("request" => $params);
     $response = $client->__soapCall("BajaEmisor", array($xml));
     return $response;
 }
Example #26
0
 public static function doCharge($params = array())
 {
     $url = Yii::app()->params["bmConfig"]["remote_wsdl"];
     $client = new SoapClient($url, array('trace' => 1));
     $result = $client->__soapCall('charging', array("xxx" => $params));
     $result = (array) $result;
     return $result;
 }
Example #27
0
 /**
  * @param string     $function_name
  * @param array      $arguments
  * @param array|null $options
  * @param null       $input_headers
  * @param array|null $output_headers
  *
  * @return array
  * @throws OmnivaException
  */
 public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
 {
     try {
         return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
     } catch (\SoapFault $fault) {
         throw new OmnivaException($fault->getMessage(), (int) $fault->getCode());
     }
 }
Example #28
0
 /**
  * @param string     $function_name
  * @param array      $arguments
  * @param array|null $options
  * @param null       $input_headers
  * @param array|null $output_headers
  *
  * @return array
  * @throws DigiDocException
  */
 public function __soapCall($function_name, $arguments, $options = null, $input_headers = null, &$output_headers = null)
 {
     try {
         return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
     } catch (\SoapFault $fault) {
         throw new DigiDocException($fault->detail->message, (int) $fault->faultstring);
     }
 }
Example #29
0
 function getSearch()
 {
     $client = new SoapClient($this->ws);
     $param = array('db' => $this->database, 'table' => $this->table, 'keyword' => $this->keyword, 'pageNo' => $this->pageno, 'pageSize' => $this->pagesize);
     $arr = $client->__soapCall('Search', array('parameters' => $param));
     $out = $this->handleResult($arr);
     return $out;
 }
Example #30
0
 /**
  * SOAP call
  *
  * @param string $functionName
  * @param mixed $arguments
  */
 private function soapCall($functionName, $arguments = array())
 {
     $result = null;
     try {
         $result = $this->soapClusterClient->__soapCall($functionName, $arguments, null, $this->soapInputHeader);
     } catch (\SoapFault $e) {
         $response = $this->soapLoginClient->__getLastResponse();
         echo '<pre>';
         var_dump($e);
         echo '</pre>';
         echo '<hr />';
         echo '<h2>SoapFault response</h2>';
         echo '<pre>';
         var_dump($e->detail);
         echo '</pre>';
     }
     return $result;
 }