Problem

When creating shipments, the following error occurs:


Invalid XML: cvc-complex-type.2.4.d: Invalid content was found starting with element 'Shipment'. No child element is expected at this point.

...

statusMessage="Das verwendete XML ist ungültig." statusText="Not-Wellformed or invalid XML"



Cause

This error occurs when too many shipments are transmitted to DHL at once. The DHL server only accepts up to 50 shipments in one single request.


If this limit is exceeded, the DHL server responds with the above error message. However, the message can be a bit misleading. The XML is not really invalid, it is just too long.


Solution 1

Correct any errors in the shipments in Magento (e.g. due to invalid addresses), so the queue does not become too long. You can filter for the DHL Label Status (crossed-out DHL icon) in the order overview.



If too many failed shipments pile up in Magento, those may break the process, leading to the above error message.


Solution 2

Transmit fewer shipments in one go to DHL (up to 50 shipments), or execute the transmission more often if you have a very large shipment volume.