Я пытаюсь воспроизвести XML в PHP SOAP , и я застреваю, когда пытаюсь установить атрибут .
Пример:
- что я хочу воспроизвести
Как выглядит мой код:
$ headerToken = new \SoapHeader ($ asxm, 'fueloauth', $ auth ['accessToken']);
$ headerContentType = new \ SoapHeader ($ asxm, 'Content-Type', 'text / xml');
$ headerSAOPAction = new \ SoapHeader ($ asxm, 'SOAPAction', 'Retrieve');
$soapClient = new \SoapClient(
$wsdl,
array(
'trace' => true,
'location' => $asxm,
'soapaction' => 'retrieve',
'exceptions ' => true,
)
);
$soapClient->__setSoapHeaders(array($headerToken,$headerContentType,$headerSAOPAction));
$RetrieveRequest = new \stdClass();
$properties = array();
$properties[] = new SoapVar('email', XSD_STRING);
$properties[] = new SoapVar('lastclick', XSD_STRING);
$filterClass = new \stdClass();
$filterClass->Property = 'created_at';
$filterClass->SimpleOperator = 'greaterThanOrEqual';
$filterClass->Value = '08/28/2018 00:00:00 AM ';
$params = array();
$params['ObjectType'] = new SoapVar('DataExtensionObject[foo]', XSD_STRING, null, null, 'ObjectType' );
$params['Properties'] = $properties;
$params['Filter'] = new SoapVar($filterClass, SOAP_ENC_OBJECT);
$RetrieveRequest->RetrieveRequest = $params;
Что я получаю с этим кодом
Как видите, он пропускает атрибут фильтра:
<Filter xsi:type="SimpleFilterPart">
Кто-то знает, как я могу это сделать в PHP SOAP?
Я уже пробовал что-то подобное, но это не работает ..
array("foo" => array("_" => "cheese", "bar"=>"moo"));
Спасибо!