最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php soap扩展开启与__soapCall使用问题
时间:2022-06-24 17:02:50 编辑:袖梨 来源:一聚教程网
例子
try {
$client = new SoapClient("http://localhost:8080/Webtest/NewService?wsdl");
// $result = $client->__soapCall("operation",array(4));//fault
// $result = $client->__soapCall("operation",array("id"=>4));//fault
// $result = $client->operation(4);//fault
$result = $client->operation(array("id"=>4));//OK
$back = json_encode($result);
echo $back;
} catch (SoapFault $fault){
echo "Error: ",$fault->faultcode,", string: ",$fault->faultstring;
}
?>
//仅有标记为OK的那行可以成功返回数字4,其它返回的都是数字0(参数应该是没有传过去,服务器端id初始是0)。
//手册里soapcall的例子:
$client = new SoapClient("some.wsdl");
$client->SomeFunction($a, $b, $c);
$client->__soapCall("SomeFunction", array($a, $b, $c));
$client->__soapCall("SomeFunction", array($a, $b, $c), NULL,
new SoapHeader(), $output_headers);
$client = new SoapClient(null, array('location' => "http://localhost/soap.php",
'uri' => "http://test-uri/"));
$client->SomeFunction($a, $b, $c);
$client->__soapCall("SomeFunction", array($a, $b, $c));
$client->__soapCall("SomeFunction", array($a, $b, $c),
array('soapaction' => 'some_action',
'uri' => 'some_uri'));
?>
相关文章
- 《1号会员店》关闭自动续费方法 01-29
- 《排球少年:新的征程》社团每日福利领取方法 01-29
- 《椿之歌》新手风属性队伍推荐 01-29
- 《最终幻想14:水晶世界》小小阿托莫斯宠物获得方法 01-29
- 《燕云十六声》醉拳客打法攻略 01-29
- 《异人之下》全货币获取方法汇总 01-29