怎么用PHP调用WebService
时间:2021-07-01 10:21:17
帮助过:15人阅读
如何用PHP调用WebService?
别的系统有个WebService,http://118.145.3.40:9082/mblWebService/services/MaiCarInfoService?wsdl
我想用PHP来调用这个WebService。网上查了一下,这么写的:
$client = new SoapClient("http://118.145.3.40:9082/mblWebService/services/MaiCarInfoService?wsdl",
array('encoding'=>'UTF-8'));
$parm1 = "abcdefg";
$param = array('param0' => $parm1);
$arr = $client->sendMaiCarInfo($param);
var_dump($arr);
本来应该传XML字符串的,我先传个abcdefg测试一下,但是对方说根本没有被调用。
麻烦看一下怎么回事吧。PHP我也不熟啊~~
分享到:
更多
------解决方案--------------------$parm1 = "abcdefg";
$param = array('in0' => $parm1);
$arr = $client->sendMaiCarInfo($param);
返回
stdClass Object
(
[out] => 解析XML出错,不符合XML标准
)
$parm1 = '1234';
$param = array('in0' => $parm1);
$arr = $client->sendMaiCarInfo($param);
返回
stdClass Object
(
[out] => success
)