NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
making simple client and server (php 5.3.1)


Joined: 28 Feb 2010
Posts: 1
Reply with quote
Hello

Can someone give a hint why this isn't working ?

client

Code:

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

Code:

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.
View user's profileFind all posts by nullsoulSend private message
making simple client and server (php 5.3.1)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic