【发布时间】:2009-05-29 21:09:18
【问题描述】:
我正在尝试像这样在 PHP (5.2.5) 中进行非 WSDL 调用。我确定我错过了一些简单的东西。这个调用有一个参数,一个字符串,叫做“timezone”:
$URL = 'http://www.nanonull.com/TimeService/TimeService.asmx';
$client = new SoapClient(null, array(
'location' => $URL,
'uri' => "http://www.Nanonull.com/TimeService/",
'trace' => 1,
));
// First attempt:
// FAILS: SoapFault: Object reference not set to an instance of an object
$return = $client->__soapCall("getTimeZoneTime",
array(new SoapParam('ZULU', 'timezone')),
array('soapaction' => 'http://www.Nanonull.com/TimeService/getTimeZoneTime')
);
// Second attempt:
// FAILS: Generated soap Request uses "param0" instead of "timezone"
$return = $client->__soapCall("getTimeZoneTime",
array('timezone'=>'ZULU' ),
array('soapaction' => 'http://www.Nanonull.com/TimeService/getTimeZoneTime')
);
感谢您的任何建议
-戴夫
【问题讨论】:
-
注意
uri是命名空间,SoapClient会称它为ns1。看到这个答案stackoverflow.com/a/959339/475876
标签: php web-services soap