复制代码
2、soapclient
$soap = new soapclient($wsdl,$array);
复制代码
3、soapfault
$fault = new soapfault($faultcode,$faultstring);
复制代码
两种引用方式: 方式1,引入wsdl文件。方式2,不使用wsdl文件。
以下的例子便是不使用wsdl文件的方式。
服务器端代码:
abcd)); $server->setclass(service); $server->handle(); ?>
客户端代码:
http://localhost/interface/soap.php, uri => abcd, //资源描述符服务器和客户端必须对应 style => soap_rpc, use => soap_encoded )); echo $soap->add(1,2); }catch(exction $e){ echo print_r($e->getmessage(),true); } ?>
