1
I’m trying to create a Webservice using the nusooap. However my return is always empty. Online is created the webservice and I can see the methods and xml (WSDL). But when trying to access via cliente.php
the return is vázio.
test-server.php
require_once "php/class/nusoap-0.9.5/lib/nusoap.php";
$soap = new soap_server;
$soap->configureWSDL('WS-WebCodeFree', 'http://www.philipsvaloriza.com.br/teste-server.php');
$soap->wsdl->schemaTargetNamespace = 'http://www.philipsvaloriza.com.br/teste-server.php';
$soap->register(
'info',
array(),
array('x' => 'xsd:string'),
'http://soapinterop.org/'
);
$soap->register(
'post_java',
array(),
array('x' => 'xsd:string'),
'http://soapinterop.org/'
);
$soap->register(
'post_php',
array(),
array('x' => 'xsd:string'),
'http://soapinterop.org/'
);
$soap->register(
'login_user',
array('login' => 'xsd:string','pass' => 'xsd:int'),
array('x' => 'xsd:string'),
'http://soapinterop.org/'
);
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : 'teste123';
$soap->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '');
function info(){
return "WebCodeFree - Desenvolvimento Web.";
}
function post_java(){
return "Em Breve Acesso a Postagens Java Via Serviço";
}
function post_php(){
return "Em Breve Acesso a Postagens PHP Via Serviço";
}
function login_user($login, $senha){
return "Seja Bem Vindo Usuário ". $login . " !!!";
}
php client.
include('lib/nusoap.php');
$cliente = new nusoap_client('http://localhost/vinicius/thiengo/doc/projects/web-service-php-nusoap/servidor.php?wsdl');
$result1 = $client->call('info');
$result2 = $client->call('post_java');
$result3 = $client->call('post_php');
$result4 = $client->call('login_user', array('Paulo',12));
echo $result1."<br>";
echo $result2."<br>";
echo $result3."<br>";
echo $result4."<br>";
Reference: http://www.webcodefree.com.br/blog/? p=1480
What is the php version? 5.6?
– rray
Yes @rray the server is using PHP 5.6
– alan