- <?php
- header("Content-Type: text/html; charset=utf-8");
- /*
- * 指定WebService路径并初始化一个WebService客户端
- */
- $ws = "http://192.168.1.100/ac/webservice/abc?wsdl";
- $client = new SoapClient($ws,array('trace' => 1,'uri'=>'http://www.test.com/SoapDiscovery/'));
- /*
- * 获取SoapClient对象引用的服务所提供的所有方法
- */
- echo("SOAP服务器提供的开放函数:");
- echo('<pre>');
- var_dump($client->__getFunctions());
- echo('</pre>');
- echo("SOAP服务器提供的Type:");
- echo('<pre>');
- var_dump($client->__getTypes());
- echo('</pre>');
- echo("执行GetGUIDNode的结果:");
- $d= array("in1"=> "5","in2"=> "5","in3"=> "5");
- $username = $client->RankPage($d);
- var_dump($username);
- echo(htmlspecialchars($client->__getLastRequest()));
- echo('<hr>');
- echo(htmlspecialchars($client->__getLastResponse()));
- echo('<hr>');
- echo('<hr>');
- ?>
本文转自许琴 51CTO博客,原文链接:http://blog.51cto.com/xuqin/925181,如需转载请自行联系原作者