您好,欢迎访问一九零五行业门户网

php webservice 测试

client.php
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
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 形式的
$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文件
soap_1_2));
//$client = new soapclient(http://localhost/ktvme/wsdl1.php?wsdl);
//$something =  $client->newoperation(array());
$something =  $client->newoperation();
echo $something->newoperationresponse;
die();
?>
其它类似信息

推荐信息