nguyenquyet2810 / nusoap-for-php5

Automatically exported from code.google.com/p/nusoap-for-php5
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Identifying client address by server #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a question regarding a identifying the client by server. When I
write a simple helloworld server and client codes all wsdl and other
functions are working. But I want to identify the requesting client in
server code and respond (To set in return value in hellowold function) that
client address back to client. Please help me to solve this.  

My nusoap.php in lib folder and all code in 'http://localhost/services/'  

Cleint code:  
require_once('./lib/nusoap.php');  
$client = new nusoap_client('http://localhost/services/server.php?wsdl',
'true');  
echo $result = $client->call('helloworld');  

Server code: (server.php)  

require_once('lib/nusoap.php');  
$server = new soap_server();  
$server->configureWSDL('hellowsdl','urn:hellowsdl');  

$server->register('helloworld',  
array('name' = 'xsd:string'),  
array('return' = 'xsd:string'),  
'urn:hellowsdl',  
'urn:hellowsdl#hello',  
'rpc',  
'encoded',  
'Says hello to the caller'  
);  

function helloworld()  
{  
return "Hi, ";  
// I want to return requester(Client) address (Ip or url)
here..................  
// Return (This is your address.............)  
}  
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);

Original issue reported on code.google.com by samuda...@gmail.com on 21 Apr 2009 at 11:28