callServer.php //serverSoap.phpphp $,server
<?php
//serverSoap.php
$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;
}<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> callServer.php </title>
<meta charset="UTF-8">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head> <body>
<form method="post" action="">
a:<input type="text" name="numa"><br>
b:<input type="text" name="numb"><br>
<input type="submit">
</form>
<hr><?php
//client端 clientSoap.php
$a=(isset($_POST["numa"]))?$_POST["numa"]:100;
$b=(isset($_POST["numb"]))?$_POST["numb"]:90;
try {
$client = new SoapClient(null,
array('location' =>"http://127.0.0.1/myphp/serverSoap.php",'uri' => "http://127.0.0.1/")
);
echo $client->minus_func($a,$b);
} catch (SoapFault $fault){
echo "Error: ",$fault->faultcode,", string: ",$fault->faultstring;
}
?>
</body>
</html>
你可能想看:
PHP版本号--phpversion(),PHP,VERSION,PHP,VERSION,IDphp版本号比较
Windows10 安装APPX程序 PowerShell方式powershell安装appx
PHP Embedding HTML And PHPphp htmlspecialchars
PHP strstrstrstr php
How to Uninstall (or Reinstall) Windows 10’s Ubuntu Bash Shellplease uninstall and reinstall the
PHP配置指令作用域说明(PHP,INI,PERDIR、PHP,INI,SYSTEM、PHP,INI,USER、PHP,INI,ALL)php 作用域
Windows Server 2012之Windows PowerShell Web(3)2003 windows powershell
Windows Server 2012 PowerShell网站服务windows powershell
How to Check TLS Version in Linux: Secure Your Servers Easily and Avoid Security Risks
PHP之——在WAMPSERVER下增加多版本的PHP(PHP5.3,PHP5.4,PHP5.5)支持。wampserver打开php项目