Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soap/Order/getOrderListResponse #55

Open
Eayshwary opened this issue Feb 2, 2019 · 0 comments
Open

Soap/Order/getOrderListResponse #55

Eayshwary opened this issue Feb 2, 2019 · 0 comments

Comments

@Eayshwary
Copy link

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

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

/**
* 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant