Cdiscount / API-MarketPlace-SDK-PHP

15 stars 42 forks source link

Soap/Order/getOrderListResponse #55

Open Eayshwary opened 5 years ago

Eayshwary commented 5 years ago

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 )

                [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

/**

but need to see why serialisation fails and the fatal error comes in some more states like this while order fetching