SOAP和PHP不工作|未捕获的SoapFault异常:[HTTP]错误获取http标头

时间:2012-07-18 13:37:55

标签: php soap

拥有此代码:

set_time_limit(100);
ini_set('user_agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1');
ini_set('default_socket_timeout', 100);
ini_set('soap.wsdl_cache_enabled', 0);

echo '<plaintext style="font-size:20px;">';

$client = new SoapClient('http://www.test/?wsdl', array(
    'soap_version'  => SOAP_1_2,
    'cache_wsdl'    => WSDL_CACHE_NONE,
    'use'           => SOAP_LITERAL,
    'style'         => SOAP_DOCUMENT,
    'user_agent'    => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1',
    'connection_timeout' => 120
));

// $result = $client->ValidaRut(array(
$result = $client->__call('ValidaRut', array(
    'rut'       => 11111111,
    'dv'        => '1',
    'cup'       => '1',
    'ipserver'  => gethostbyname($_SERVER['SERVER_NAME']) ,
    'ipcliente' => $_SERVER['REMOTE_ADDR']
));

但是不行,php说: 致命错误:未捕获的SoapFault异常:[HTTP]错误在/ home /.../ test.php中获取http标头:1

会发生什么?抱歉,我的英文。 转储数据:

print_r($client->__getFunctions());
Array
(
    [0] => ValidaRutResponse ValidaRut(ValidaRut $parameters)
)

print_r($client->__getTypes());
Array
(

    [0] => struct ValidaRut {
 double rut;
 string dv;
 string cup;
 string ipserver;
 string ipcliente;
}
    [1] => struct ValidaRutResponse {
 boolean ValidaRutResult;
}
    [2] => int char
    [3] => duration duration
    [4] => string guid
)

安全模式已关闭。我使用WHM / cPanel,安装了库。感谢。

1 个答案:

答案 0 :(得分:0)

对不起,服务器出现故障。