the code written in construct of this class GetOrderListResponse.php is like
public function __construct($response)
{
$reader = new \Zend\Config\Reader\Xml();
$this->_dataResponse = $reader->fromString($response);
if ($this->isOperationSuccess($this->_dataResponse['s:Body']['GetOrderListResponse']['GetOrderListResult']))
{
$this->_orderList = new OrderList();
/**
Global informations
*/
$this->_setGlobalInformations();
/**
Order list
*/
$this->_setOrderList();
}
}
but when fetching orders with \Sdk\Order\OrderStateEnum::ShippedBySeller this as an state
[faultstring] => Array
(
[_] => The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://www.cdiscount.com:orderFilter. The InnerException message was 'Invalid enum value 'ShippedBySeller' cannot be deserialized into type 'Cdiscount.Service.Marketplace.API.External.Contract.Data.Order.OrderStateEnum'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'. Please see InnerException for more details.
[lang] => fr-FR
)
)
)
)
so in construct it is not getting the DataResponse key $this->_dataResponse['s:Body']['GetOrderListResponse']
cause breakdown and fatal error on site
quick fix
/**
GetOrderListResponse constructor.
@param $response
*/
public function __construct($response)
{
$reader = new \Zend\Config\Reader\Xml();
$this->_dataResponse = $reader->fromString($response);
$checkExistence = $this->_dataResponse;
if (isset($this->_dataResponse['s:Body']['GetOrderListResponse']['GetOrderListResult'])) {
if ($this->isOperationSuccess($this->_dataResponse['s:Body']['GetOrderListResponse']['GetOrderListResult']))
{
$this->_orderList = new OrderList();
/**
* Global informations
*/
$this->_setGlobalInformations();
/**
* Order list
*/
$this->_setOrderList();
}
}
}
but need to see why serialisation fails and the fatal error comes in some more states like this while order fetching
the code written in construct of this class GetOrderListResponse.php is like public function __construct($response) { $reader = new \Zend\Config\Reader\Xml(); $this->_dataResponse = $reader->fromString($response); if ($this->isOperationSuccess($this->_dataResponse['s:Body']['GetOrderListResponse']['GetOrderListResult'])) { $this->_orderList = new OrderList(); /**
but when fetching orders with \Sdk\Order\OrderStateEnum::ShippedBySeller this as an state
the response is this ->
Array ( [s:Body] => Array ( [s:Fault] => Array ( [faultcode] => Array ( [_] => a:DeserializationFailed [a] => http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher )
)
so in construct it is not getting the DataResponse key $this->_dataResponse['s:Body']['GetOrderListResponse']
cause breakdown and fatal error on site
quick fix
/**
@param $response */ public function __construct($response) { $reader = new \Zend\Config\Reader\Xml(); $this->_dataResponse = $reader->fromString($response); $checkExistence = $this->_dataResponse; if (isset($this->_dataResponse['s:Body']['GetOrderListResponse']['GetOrderListResult'])) { if ($this->isOperationSuccess($this->_dataResponse['s:Body']['GetOrderListResponse']['GetOrderListResult'])) { $this->_orderList = new OrderList();
}
but need to see why serialisation fails and the fatal error comes in some more states like this while order fetching