Error while fetching HTTP headers in php Web Services

Asked

Viewed 51 times

1

I am learning how to create Web Services and I am making two files in php, server and client. Server.php

<?php
class functions
{

    function mensagem()
    {
        return 'hello server';
    }
    function soma($a, $b)
    {
        return $a + $b;
    }

}

$options = array('uri' => 'http://127.0.0.1/teste/index.php');
$server  = new soapServer(null, $options);

$server->setClass('functions');
$server->handle();


?>

Php client.

<?php

$options = array('location' => 'http://127.0.0.1/teste/cliente.php', 
'uri' => '127.0.0.1/teste/index.php');
$cliente = new soapClient(null, $options);

try{

    print($cliente->soma(2, 3));

} catch(Exception $e)
{

    print $e->getMessage();

}

?>

When running the.php client script the following error

Error fetching HTTP headers

I’ve already increased the timeout to 600s, the way I saw in Stackoverflow English, but only left but time consuming the same answer. Can someone give a help?

  • You tried to increase the response time? Shouldn’t be the timeout?

  • yes yes. misspelled.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.