xmlrpc_parse_method_descriptions> <xmlrpc_get_type
Last updated: Fri, 24 Feb 2012

xmlrpc_is_fault

(PHP 4 >= 4.3.0, PHP 5)

xmlrpc_is_faultDetermina se um valor de array representa uma falha XMLRPC

Descrição

bool xmlrpc_is_fault ( array $arg )
Aviso

Esta função é EXPERIMENTAL. O comportamento desta função, seu nome, incluindo toda documentação pode ser modificado sem aviso em futuras versões do PHP. Esta função deve ser usada por sua própria conta e risco.

Parâmetros

arg

Array retornado por xmlrpc_decode().

Valor Retornado

Retorna TRUE se o argumento significa falha, FALSE caso contrário. Descrição da falha está disponível em $arg["faultString"], código da falha está em $arg["faultCode"].

Exemplos

Veja o exemplo em xmlrpc_encode_request().

Veja Também



User Contributed Notes
xmlrpc_is_fault
angelo at at dot com
25-Jan-2011 10:31
A note, response from xmlrpc_decode is not always an array. Whenever the XMLRPC server returns a string, xmlrpc_is_fault will complain about not being an array.

Best way to detect errors is

<?php

   
    $response
= xmlrpc_decode($file);

    if (
is_array($response) && xmlrpc_is_fault($response)) {
        throw new
Exception($response['faultString'], $response['faultCode']);
    }
   
?>

xmlrpc_parse_method_descriptions> <xmlrpc_get_type
Last updated: Fri, 24 Feb 2012