本文整理汇总了PHP中is_soap_fault函数的典型用法代码示例。如果您正苦于以下问题:PHP is_soap_fault函数的具体用法?PHP is_soap_fault怎么用?PHP is_soap_fault使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_soap_fault函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculoAportacionCiudadano
/**
*
* @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()));
}
示例2: parse
public function parse($response)
{
if (is_array($response)) {
$result = array_shift($response);
$xml = $result->any;
$matches = array();
if (preg_match('/<ResultStatus>(?<status>[^\\>]*)<\\/ResultStatus>/', $xml, $matches) != false) {
$this->resultStatus = $matches['status'];
}
if (preg_match('/<ResultMessage>(?<message>[^\\>]*)<\\/ResultMessage>/', $xml, $matches) != false) {
$this->resultMessage = $matches['message'];
}
} elseif (is_string($response)) {
$matches = array();
if (preg_match('/<ResultStatus>(?<status>[^\\>]*)<\\/ResultStatus>/', $response, $matches) != false) {
$this->resultStatus = $matches['status'];
}
if (preg_match('/<ResultMessage>(?<message>[^\\>]*)<\\/ResultMessage>/', $response, $matches) != false) {
$this->resultMessage = $matches['message'];
}
} elseif (is_soap_fault($response)) {
$this->resultStatus = $response->getCode();
$this->resultMessage = $response->getMessage();
}
}
示例3: synthesize
/**
* 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'];
}
示例4: info
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;
}
示例5: GetRegZavod
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();
}
}
示例6: __soapCall
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;
}
}
示例7: overRedirectMax
/**
* @test
*/
public function overRedirectMax()
{
// no exception option
$obj = new CurlSoapClient(null, array('location' => 'http://localhost:8000/tests/server.php?redirect=2', 'uri' => 'http://test-uri/', 'redirect_max' => 1, 'exceptions' => false));
$response = $obj->test(123);
$this->assertInstanceOf('SoapFault', $response);
$this->assertTrue(is_soap_fault($response));
}
示例8: check_soap
/**
* @param $soapResult
* @return mixed
* @throws \Exception
*/
public static function check_soap($soapResult)
{
if (is_soap_fault($soapResult)) {
$err = "QAS SOAP Fault - " . "Code: {" . $soapResult->faultcode . "}, " . "Description: {" . $soapResult->faultstring . "}";
error_log($err, 0);
throw new \Exception($err);
}
return $soapResult;
}
示例9: dummy
public static function dummy($client)
{
$results = $client->FEDummy();
printf("appserver status: %s\ndbserver status: %s\nauthserver status: %s\n", $results->FEDummyResult->appserver, $results->FEDummyResult->dbserver, $results->FEDummyResult->authserver);
if (is_soap_fault($results)) {
throw new WsfeException($results->faultcode, $results->faultstring);
}
return;
}
示例10: __call
/**
* Execute the request to the server
*
* @param string $method
* @param array $parameters
*/
public function __call($method, $parameters)
{
array_unshift($parameters, $this->token());
$result = $this->soap()->__soapCall($method, $parameters);
if (is_soap_fault($result)) {
return;
}
return $this->sanitize($result);
}
示例11: dummy
function dummy($client)
{
$results = $client->FEDummy();
printf("appserver status: %s\ndbserver status: %s\nauthserver status: %s\n", $results->FEDummyResult->appserver, $results->FEDummyResult->dbserver, $results->FEDummyResult->authserver);
if (is_soap_fault($results)) {
printf("Fault: %s\nFaultString: %s\n", $results->faultcode, $results->faultstring);
exit(1);
}
return;
}
示例12: getResponse
/**
* Get the API ID
*
* @return string Returns "self"
* @access public
*/
public function getResponse()
{
if (is_soap_fault($this->wsResponse)) {
return json_encode(array('error' => array('code' => $this->wsResponse->faultcode, 'message' => $this->wsResponse->faultstring)));
}
if (!is_array($this->wsResponse)) {
return json_encode(array('result' => $this->wsResponse));
}
return json_encode($this->wsResponse);
}
示例13: CallWSAA
function CallWSAA($CMS)
{
$client = new SoapClient(WSDLA, array('soap_version' => SOAP_1_2, 'location' => URL, 'trace' => 1, 'exceptions' => 0));
$results = $client->loginCms(array('in0' => $CMS));
file_put_contents("request-loginCms.xml", $client->__getLastRequest());
file_put_contents("response-loginCms.xml", $client->__getLastResponse());
if (is_soap_fault($results)) {
exit("SOAP Fault: " . $results->faultcode . "\n" . $results->faultstring . "\n");
}
return $results->loginCmsReturn;
}
示例14: BatchSend
public function BatchSend($mobiel, $content)
{
$client = $this->getSoapClient();
$param = ['Mobile' => $mobiel, 'Content' => $content, 'Cell' => '', 'SendTime' => ''];
$param = array_merge($this->getInitParams(), $param);
$result = $client->__Call('BatchSend', array('paramters' => $param));
if (is_soap_fault($result)) {
trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
}
return $result;
}
示例15: getInfo
function getInfo($tag)
{
$args = array('guid' => self::GUID, 'applicationName' => 'GLPI', 'serviceTags' => $tag);
$reponse = parent::__soapCall('GetAssetInformation', array($args));
//print_r($reponse);
if (is_soap_fault($reponse)) {
echo "SOAP Fault: ";
print_r($reponse);
return NULL;
}
return isset($reponse->GetAssetInformationResult) ? $reponse->GetAssetInformationResult : NULL;
}