index.php
<?php
require_once "nusoap.php";
$server = new soap_server;
$server->register('hello');
function hello($name){
return 'Hello, '.$name.' From Soap Server';
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>While the client code is:
<?php
require_once 'nusoap.php';
$client = new SoapClient(
null,
array(
'location' => 'http://localhost/index.php',
'uri' => 'http://localhost:80',
'soap_version' => '0.9.5',
)
);
$result = $client->hello('Barack Obama');
print_r($result);
?>
where to get the nusoap.php file from. what is in it?
ReplyDeleteTo get nusoap, just googling it, and you will get link to sourceforge.net
ReplyDeleteBut i recommmend to use Zend SOAP. It makes very productive and the most is its easiness. Try to check my post in Zend tags.