client.php
/*
try {
$client = new SoapClient (NULL,
Array (' location ' = = ' http://127.0.0.1/ktvme/serverSoap.php ', ' uri ' = ' http://127.0.0.1/')
);
echo $client->minus_func (100,99);
} catch (SoapFault $fault) {
echo "Error:", $fault->faultcode, ", String:", $fault->faultstring;
}
*/
try {
$client = new SoapClient (NULL,
Array (' location ' = = ' http://127.0.0.1/ktvme/serverSoap.php ', ' uri ' = ' http://127.0.0.1/')
);
echo $client->getname ();
} catch (SoapFault $fault) {
echo "Error:", $fault->faultcode, ", String:", $fault->faultstring;
}
?>
serversoap.php
/*//function in the form of
$soap = new SoapServer (Null,array (' uri ' = "http://127.0.0.1/"));//this URI is your SERVER IP.
$soap->addfunction (' Minus_func '); Register the function
$soap->addfunction (Soap_functions_all);
$soap->handle ();
function Minus_func ($i, $j) {
$res = $i-$j;
return $res;
}
*/
Class-Form
$classExample = Array ();
$soap = new SoapServer (Null,array (' uri ' = ' http://127.0.0.1/', ' classexample ' = = $classExample));
$soap->setclass (' Chesterclass ');
$soap->handle ();
Class Chesterclass {
Public $name = ' Chester ';
function GetName () {
return $this->name;
}
}
?>
WSDDL file
Header ("content-type:text/html; Charset=utf-8 ");
Echo ' Hi
';
$client = new SoapClient ("http://localhost/ktvme/wsdl1.wsdl", Array (' soap_version ' = soap_1_2));
$client = new SoapClient ("http://localhost/ktvme/wsdl1.php?wsdl");
$something = $client->newoperation (array ());
$something = $client->newoperation ();
Echo $something->newoperationresponse;
Die ();
?>