0

Trying to Connect DHL with default DHL module in Magento 2.2.6 but getting error for any quote request:

    <Status>
        <ActionStatus>Error</ActionStatus>
        <Condition>
            <ConditionCode>111</ConditionCode>
            <ConditionData>Error in parsing request XML:Invalid byte
                2 of 2-byte UTF-8 sequence.</ConditionData>
        </Condition>
    </Status>

Copied it to dhl test environment - all works ok... What can be a reason?


    [2018-12-07 08:52:17] main.DEBUG: array (
  'request' => '<?xml version="1.0" encoding="UTF-8"?>
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd "><GetQuote xmlns=""><Request><ServiceHeader><SiteID>****</SiteID><Password>****</Password></ServiceHeader></Request><From><CountryCode>RU</CountryCode><Postalcode>117216</Postalcode><City>москва</City></From><BkgDetails><PaymentCountryCode>RU</PaymentCountryCode><Date>2018-12-07</Date><ReadyTime>PT24H00M</ReadyTime><DimensionUnit>CM</DimensionUnit><WeightUnit>KG</WeightUnit><Pieces xmlns=""><Piece xmlns=""><PieceID>1</PieceID><Weight>0.500</Weight></Piece></Pieces><PaymentAccountNumber>380863334</PaymentAccountNumber><IsDutiable>Y</IsDutiable></BkgDetails><To><CountryCode>RU</CountryCode><Postalcode>156005</Postalcode><City>Кострома</City></To><Dutiable><DeclaredCurrency>RUB</DeclaredCurrency><DeclaredValue>2500.00</DeclaredValue></Dutiable></GetQuote></p:DCTRequest>
',
  'from_cache' => true,
  'response' => '<?xml version="1.0" encoding="UTF-8"?>
<res:ErrorResponse xmlns:res="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com err-res.xsd">
    <Response>
        <ServiceHeader>
            <MessageTime>2018-12-07T09:52:17.064+01:00</MessageTime>
            <SiteID>****</SiteID>
            <Password>****</Password>
        </ServiceHeader>
        <Status>
            <ActionStatus>Error</ActionStatus>
            <Condition>
                <ConditionCode>111</ConditionCode>
                <ConditionData>Error in parsing request XML:Invalid byte
                    2 of 2-byte UTF-8 sequence.</ConditionData>
            </Condition>
        </Status>
    </Response></res:ErrorResponse>
<!-- ServiceInvocationId:20181207095217_96ab_5c00e6b6-8e43-4716-bac4-31404e508288 -->
',
) [] []
  • Is your country supported by default DHL module? – Milind Singh Dec 7 '18 at 9:18
  • Can a country settings relate to xml parsing error? – ferret-e Dec 8 '18 at 10:05
  • I think Different countries have different API for DHL. Only a set of countries are supported by the API Magento 2 module is using. – Milind Singh Dec 8 '18 at 10:18
  • No, it is single api for all. There is a separate thing exists too - DHL Ecommerce with its own api and limited list of countries, but it is a different case. – ferret-e Dec 9 '18 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.