1
Good morning. I’m trying to mess with SOAP Web Service but I’m having problems. When I run client.php in the browser it doesn’t work. Does anyone know how to solve?
php server.
<?php
$options = array('uri' => 'http://alairrepresentacoes-com-br.umbler.net/');
$server = new SoapServer(null, $options);
$server->setClass('MeuSoapServer');
$server->handle();
class MeuSoapServer {
public function mensagem($nome)
{
return "Boas Vindas $nome !";
}
public function soma($a, $b)
{
return $a + $b;
}
}
?>
client.php
<?php
$options = array(
'location' => 'http://alairrepresentacoes-com-br.umbler.net/servidor.php',
'uri' => 'http://alairrepresentacoes-com-br.umbler.net/'
);
$client = new SoapClient(null, $options);
echo $client->mensagem('Douglas') . "<br />";
echo $client->soma(3, 5) . "<br />"
?>
Thank you in advance.
Thank you very much, I don’t know how I forgot the semicolon kkk
– Vinícius Assis Neves
Your reply was very complete, it helped a lot. I would just like to ask about Uri and Location? They are right so?
– Vinícius Assis Neves
@Viníciusasisneves as per the example of the documentation http://php.net/manual/soapclient.soapclient.php#example-6247 is correct yes yes.
– Guilherme Nascimento