分类:
2009-10-28 16:08:23
[CODE:]client.php
$client = new SoapClient("stockquote.wsdl");
print($client->getQuote("ibm"));
?>
[CODE:]server.php
$quotes = array(
"ibm" => 98.42888
);
function getQuote($symbol) {
global $quotes;
return $quotes[$symbol];
}
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$server = new SoapServer("stockquote.wsdl");
$server->addFunction("getQuote");
$server->handle();
?>
[CODE:]stockquote.wsdl
='1.0' encoding ='UTF-8' ?>
xmlns:tns=' '
xmlns:soap=''
xmlns:xsd=''
xmlns:soapenc=''
xmlns:wsdl=''
xmlns=''>