Hello
Can someone give a hint why this isn't working ?
client
include("nusoap/nusoap.php");
$test_client = new nusoap_client('http://localhost/nusoap_server.php');
$param = array ('find' => 'DATA_1');
$result = $test_client->call('process', $param);
echo 'Result : ' . $result;
if ($test_client->fault && is_array($result))
{
echo "\n" . "ERROR...";
echo "\n" . $test_client->faultcode . " " . $test_client->faultstring;
}
|
server
include ("nusoap/nusoap.php");
$test_server = new nusoap_server();
$test_server->register('process');
function process ($find)
{
$data_array = array(
'DATA_1' => '1' , 'DATA_2' => '2'
);
if (array_key_exists($find, $data_array ))
{
return $data_array [$find];
}
else
{
return new nusoap_fault('Client', '', 'Unknown request!', '');
}
}
$request = isSet($_SERVER['HTTP_RAW_POST_DATA']) ? $_SERVER['HTTP_RAW_POST_DATA'] : '';
$test_server->service($request);
|
i get this from the debbuger :
Result : Array
ERROR...
SOAP-ENV:Client error in msg parsing:
xml was empty, didn't parse!
I am trying to make a simple client and server.