Tôi đang cố thực hiện cuộc gọi không phải WSDL bằng PHP (5.2.5) như thế này. Tôi chắc rằng tôi đang thiếu một cái gì đó đơn giản. Cuộc gọi này có một tham số, một chuỗi, được gọi là "múi giờ":Gọi xà phòng không phải là WSDL của PHP: làm thế nào để bạn chuyển các tham số?
$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')
);
Thanks cho bất kỳ lời đề nghị
-Dave
Đã thử, nhưng nó chuyển toàn bộ mảng thành param0. Vì vậy, không đi. –