سلام
پوشه Classes نیست بلکه باید classes بنویسید .
اینم فایل index.php که ویرایش شد :
<?php
require_once("nuSOAP/lib/nusoap.php");
require_once("classes/Connection.class.php");
require_once("classes/Customer.class.php");
$namespace = "http://localhost/CustomersWebService/index.php";
// create a new soap server
$server = new soap_server();
// configure our WSDL
$server->configureWSDL("CustomerLookup");
// set our namespace
$server->wsdl->schemaTargetNamespace = $namespace;
// tell nusoap about the complex data type
$server->wsdl->addComplexType('Customer','complexType','struct', 'all','',
array(
'id' => array('name' => 'id','type' => 'xsd:int'),
'phonenumber' => array('name' => 'phonenumber','type' => 'xsd:string'),
'businessname' => array('name' => 'businessname','type' => 'xsd:string')
));
// create an array of that new data type
$server->wsdl->addComplexType('Customers','complexType','array', '','SOAP-ENC:Array',
array(),
array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Customer[]')),'tns:Customer');
$server->register(
// method name:
'GetAllCustomers',
// parameter list:
array(),
// return value(s):
array('return'=>'tns:Customers'),
// namespace:
$namespace,
// soapaction: (use default)
false,
// style: rpc or document
'rpc',
// use: encoded or literal
'encoded',
// description: documentation for the method
'Returns an exhaustive list of all customers in the database');
function GetAllCustomers()
{
$database = new Connection();
$result = $database->runQuery("SELECT * FROM customers");
$num = mysql_num_rows($result);
if($num == 0)
{
return "";
}
else
{
$results = array();
for($i=0;$i<$num;$i++)
{
$tempArray = array('id' => mysql_result($result,$i,"ID"),
'phonenumber' => mysql_result($result,$i,"PHONE_NUMBER"),
'businessname' => mysql_result($result,$i,"BUSINESS_NAME"),
);
array_push($results, $tempArray);
}
return $results;
}
}
// Get our posted data if the service is being consumed
// otherwise leave this data blank.
$POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA'])
? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
// pass our posted data (or nothing) to the soap service
$server->service($POST_DATA);
exit();
?>