I've just started learning SOAP so please don't shoot me down if it's something stupid I've missed.
Ok here's my SOAP server code:
Code: Select all
<?php
//mysql_connect("localhost", "root", "*********") or die(mysql_error());
//mysql_select_db("mc") or die(mysql_error());
//$result = mysql_query("SELECT * FROM users WHERE id='1'") or die(mysql_error());
//$row = mysql_fetch_array( $result );
$quotes = array(
'IBM' => 98.20,
'GOOG' => 504.21
);
function getQuote($symbol) {
global $quotes;
return $quotes;
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("ptsoffice.wsdl");
$server->addFunction("getQuote");
$server->handle();
?>Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in C:\wamp\www\ptsmc\soap\client1.php:5 Stack trace: #0 [internal function]: SoapClient->__call('getQuote', Array) #1 C:\wamp\www\ptsmc\soap\client1.php(5): SoapClient->getQuote() #2 {main} thrown in C:\wamp\www\ptsmc\soap\client1.php on line 5