最新下载
热门教程
- 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'));
?>
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22