PHP SoapClient - 带有嵌套参数的 Soap 调用
PHP SoapClient - Soap call with nested parameters
如果我有以下 soap 信封,我该如何在我的 soap 调用中包含日期范围的嵌套参数?
<GetOrders xmlns="http://example.com/">
<token>string</token>
<CustomerId>integer</CustomerId>
<DateRange>
<MinimumDate xmlns="http://example.com">dateTime</MinimumDate>
<MaximumDate xmlns="http://example.com">dateTime</MaximumDate>
</DateRange>
</GetOrders>
$soap = new SoapClient('link/to/.wsdl');
$result = $soap->__soapCall('GetOrders', array('token' => 'asdad', 'CustomerId' => 1, 'MinimumDate' => '2018-10-01', 'MaximumDate' => '2018-10-16'));
var_dump($result);
通过使用嵌套数组:
$result = $soap->__soapCall('GetOrders',
array('token' => 'asdad', 'CustomerId' => 1,
'DateRange' => array('MinimumDate' => '2018-10-01', 'MaximumDate' => '2018-10-16')
));
如果我有以下 soap 信封,我该如何在我的 soap 调用中包含日期范围的嵌套参数?
<GetOrders xmlns="http://example.com/">
<token>string</token>
<CustomerId>integer</CustomerId>
<DateRange>
<MinimumDate xmlns="http://example.com">dateTime</MinimumDate>
<MaximumDate xmlns="http://example.com">dateTime</MaximumDate>
</DateRange>
</GetOrders>
$soap = new SoapClient('link/to/.wsdl');
$result = $soap->__soapCall('GetOrders', array('token' => 'asdad', 'CustomerId' => 1, 'MinimumDate' => '2018-10-01', 'MaximumDate' => '2018-10-16'));
var_dump($result);
通过使用嵌套数组:
$result = $soap->__soapCall('GetOrders',
array('token' => 'asdad', 'CustomerId' => 1,
'DateRange' => array('MinimumDate' => '2018-10-01', 'MaximumDate' => '2018-10-16')
));