Problems with DHL module in Magento 1.7.0.2 (UE countries)

In case you use the DHL module and the origin of your shipments is an Italian address or an EU country and the destination is an EU country other than that of origin, the system DHL returns no listing for any service of making it impossible to ship via DHL.

To test this we assume that the origin of your shipments is Italy and that you would like to ship a package to Paris, France.

If you activate the debug mode of the module DHL Magento under the directory var/log a file shipping_dhlint.log will be generated which contains  your quotation requests and the responses of webservices DHL.

Now put an item in cart and try to apply for the listing of a shipment (for simplicity we assume that DHL is the only shipping method enabled).
Enter the destination address and click the Get Quote button.

Nothing will appear on the frontend.

If you open the file shipping_dhlint.log you will see  the output of an array with two elements: one for the request and one for the result.

The one below is the XML 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>xxxxxxxxx</SiteID>
				<Password>xxxxxxxx</Password>
			</ServiceHeader>
		</Request>
		<From>
			<CountryCode>IT</CountryCode>
			<Postalcode>60035</Postalcode>
			<City>Jesi</City>
		</From>
		<BkgDetails>
			<PaymentCountryCode>IT</PaymentCountryCode>
			<Date>2013-08-01</Date>
			<ReadyTime>PT3H00M</ReadyTime>
			<DimensionUnit>CM</DimensionUnit>
			<WeightUnit>KG</WeightUnit>
			<Pieces xmlns="">
				<Piece xmlns="">
					<PieceID>1</PieceID>
					<Weight>1.7</Weight>
				</Piece>
			</Pieces>
			<PaymentAccountNumber></PaymentAccountNumber>
			<IsDutiable>Y</IsDutiable>
		</BkgDetails>
		<To>
			<CountryCode>FR</CountryCode>
			<Postalcode>75008</Postalcode>
			<City>Paris</City>
		</To>
		<Dutiable>
			<DeclaredCurrency>EUR</DeclaredCurrency>
			<DeclaredValue>176.79</DeclaredValue>
		</Dutiable>
	</GetQuote>
</p:DCTRequest>

And the one below is the XML response:

<?xml version="1.0"?>
<res:DCTResponse xmlns:res="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-Response.xsd">
	<GetQuoteResponse>
		<Response>
			<ServiceHeader>
				<MessageTime>2013-08-01T22:32:58.969+00:00</MessageTime>
				<SiteID>xxxxxxxxxxxx</SiteID>
			</ServiceHeader>
		</Response>
		<BkgDetails>
			<OriginServiceArea>
				<FacilityCode>MAX</FacilityCode>
				<ServiceAreaCode>AOI</ServiceAreaCode>
			</OriginServiceArea>
			<DestinationServiceArea>
				<FacilityCode>PSO</FacilityCode>
				<ServiceAreaCode>CDG</ServiceAreaCode>
			</DestinationServiceArea>
			<QtdShp>
				<GlobalProductCode>E</GlobalProductCode>
				<LocalProductCode>E</LocalProductCode>
				<ProductShortName>EXPRESS 9:00</ProductShortName>
				<LocalProductName>EXPRESS 9:00 NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT9H</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>Q</GlobalProductCode>
				<LocalProductCode>Q</LocalProductCode>
				<ProductShortName>MEDICAL EXPRESS</ProductShortName>
				<LocalProductName>MEDICAL EXPRESS NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>Y</POfferedCustAgreement>
				<TransInd>N</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT9H</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>Y</GlobalProductCode>
				<LocalProductCode>Y</LocalProductCode>
				<ProductShortName>EXPRESS 12:00</ProductShortName>
				<LocalProductName>EXPRESS 12:00 NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT12H</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>8</GlobalProductCode>
				<LocalProductCode>8</LocalProductCode>
				<ProductShortName>EXPRESS EASY</ProductShortName>
				<LocalProductName>EXPRESS EASY NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>Y</POfferedCustAgreement>
				<TransInd>N</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>P</GlobalProductCode>
				<LocalProductCode>P</LocalProductCode>
				<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
				<LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
		</BkgDetails>
		<Srvs>
			<Srv>
				<GlobalProductCode>E</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>E</LocalProductCode>
					<ProductShortName>EXPRESS 9:00</ProductShortName>
					<LocalProductName>EXPRESS 9:00 NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>Q</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>Q</LocalProductCode>
					<ProductShortName>MEDICAL EXPRESS</ProductShortName>
					<LocalProductName>MEDICAL EXPRESS NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>Y</POfferedCustAgreement>
					<TransInd>N</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>Y</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>Y</LocalProductCode>
					<ProductShortName>EXPRESS 12:00</ProductShortName>
					<LocalProductName>EXPRESS 12:00 NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>8</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>8</LocalProductCode>
					<ProductShortName>EXPRESS EASY</ProductShortName>
					<LocalProductName>EXPRESS EASY NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>Y</POfferedCustAgreement>
					<TransInd>N</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>P</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>P</LocalProductCode>
					<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
					<LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
			</Srv>
		</Srvs>
	</GetQuoteResponse>
</res:DCTResponse>

As you can see are returned 5 DHL Services but no one appears with the economic evaluation.

Now we try to make the quote request (for the same product previously selected) for a shipment with DHL for a city in Mexico.

<?xml version="1.0"?>
<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>xxxxxxxxxxxxxxxxx</SiteID>
				<Password>xxxxxxxxxxxxx</Password>
			</ServiceHeader>
		</Request>
		<From>
			<CountryCode>IT</CountryCode>
			<Postalcode>60035</Postalcode>
			<City>Jesi</City>
		</From>
		<BkgDetails>
			<PaymentCountryCode>IT</PaymentCountryCode>
			<Date>2013-08-02</Date>
			<ReadyTime>PT3H00M</ReadyTime>
			<DimensionUnit>CM</DimensionUnit>
			<WeightUnit>KG</WeightUnit>
			<Pieces xmlns="">
				<Piece xmlns="">
					<PieceID>1</PieceID>
					<Weight>1.7</Weight>
				</Piece>
			</Pieces>
			<PaymentAccountNumber/>
			<IsDutiable>Y</IsDutiable>
		</BkgDetails>
		<To>
			<CountryCode>MX</CountryCode>
			<Postalcode>84560</Postalcode>
			<City>Moctezuma</City>
		</To>
		<Dutiable>
			<DeclaredCurrency>EUR</DeclaredCurrency>
			<DeclaredValue>176.79</DeclaredValue>
		</Dutiable>
	</GetQuote>
</p:DCTRequest>

This is the response:

<?xml version="1.0"?>
<res:DCTResponse xmlns:res="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-Response.xsd">
	<GetQuoteResponse>
		<Response>
			<ServiceHeader>
				<MessageTime>2013-08-02T21:54:40.272+00:00</MessageTime>
				<SiteID>xxxxxxxxxxxxxxxxxx</SiteID>
			</ServiceHeader>
		</Response>
		<BkgDetails>
			<OriginServiceArea>
				<FacilityCode>MAX</FacilityCode>
				<ServiceAreaCode>AOI</ServiceAreaCode>
			</OriginServiceArea>
			<DestinationServiceArea>
				<FacilityCode>HMO</FacilityCode>
				<ServiceAreaCode>HMO</ServiceAreaCode>
			</DestinationServiceArea>
			<QtdShp>
				<GlobalProductCode>8</GlobalProductCode>
				<LocalProductCode>8</LocalProductCode>
				<ProductShortName>EXPRESS EASY</ProductShortName>
				<LocalProductName>EXPRESS EASY NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>Y</POfferedCustAgreement>
				<TransInd>N</TransInd>
				<PickupDate>2013-08-02</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>7</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>4</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-13</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>5</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>2</DestinationDayOfWeekNum>
				<QtdShpExChrg>
					<SpecialServiceType>OO</SpecialServiceType>
					<LocalServiceType>OO</LocalServiceType>
					<GlobalServiceName>REMOTE AREA DELIVERY</GlobalServiceName>
					<LocalServiceTypeName>REMOTE AREA DELIVERY</LocalServiceTypeName>
					<ChargeCodeType>SCH</ChargeCodeType>
				</QtdShpExChrg>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>P</GlobalProductCode>
				<LocalProductCode>P</LocalProductCode>
				<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
				<LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-02</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<CurrencyCode>EUR</CurrencyCode>
				<ExchangeRate>1.000000</ExchangeRate>
				<WeightCharge>98.000</WeightCharge>
				<WeightChargeTax>0.000</WeightChargeTax>
				<TotalTransitDays>7</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>4</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-13</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>5</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>2</DestinationDayOfWeekNum>
				<QtdShpExChrg>
					<SpecialServiceType>OO</SpecialServiceType>
					<LocalServiceType>OO</LocalServiceType>
					<GlobalServiceName>REMOTE AREA DELIVERY</GlobalServiceName>
					<LocalServiceTypeName>REMOTE AREA DELIVERY</LocalServiceTypeName>
					<ChargeCodeType>SCH</ChargeCodeType>
				</QtdShpExChrg>
				<PricingDate>2013-08-02</PricingDate>
				<ShippingCharge>98.000</ShippingCharge>
				<TotalTaxAmount>0.000</TotalTaxAmount>
				<QtdSInAdCur>
					<CurrencyCode>EUR</CurrencyCode>
					<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
					<WeightCharge>98.000</WeightCharge>
					<TotalAmount>98.000</TotalAmount>
					<TotalTaxAmount>0.000</TotalTaxAmount>
					<WeightChargeTax>0.000</WeightChargeTax>
					<WeightChargeTaxDet>
						<TaxTypeRate>0.000</TaxTypeRate>
						<TaxTypeCode>VAT</TaxTypeCode>
						<WeightChargeTax>0.000</WeightChargeTax>
						<BaseAmt>98.000</BaseAmt>
					</WeightChargeTaxDet>
				</QtdSInAdCur>
				<QtdSInAdCur>
					<CurrencyCode>EUR</CurrencyCode>
					<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
					<WeightCharge>98.000</WeightCharge>
					<TotalAmount>98.000</TotalAmount>
					<TotalTaxAmount>0.000</TotalTaxAmount>
					<WeightChargeTax>0.000</WeightChargeTax>
					<WeightChargeTaxDet>
						<TaxTypeRate>0.000</TaxTypeRate>
						<TaxTypeCode>VAT</TaxTypeCode>
						<WeightChargeTax>0.000</WeightChargeTax>
						<BaseAmt>98.000</BaseAmt>
					</WeightChargeTaxDet>
				</QtdSInAdCur>
				<QtdSInAdCur>
					<CurrencyCode>USD</CurrencyCode>
					<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
					<WeightCharge>98.000</WeightCharge>
					<TotalAmount>98.000</TotalAmount>
					<TotalTaxAmount>0.000</TotalTaxAmount>
					<WeightChargeTax>0.000</WeightChargeTax>
					<WeightChargeTaxDet>
						<TaxTypeRate>0.000</TaxTypeRate>
						<TaxTypeCode>VAT</TaxTypeCode>
						<WeightChargeTax>0.000</WeightChargeTax>
						<BaseAmt>98.000</BaseAmt>
					</WeightChargeTaxDet>
				</QtdSInAdCur>
				<WeightChargeTaxDet>
					<TaxTypeRate>0.000</TaxTypeRate>
					<TaxTypeCode>VAT</TaxTypeCode>
					<WeightChargeTax>0.000</WeightChargeTax>
					<BaseAmt>98.000</BaseAmt>
				</WeightChargeTaxDet>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>Q</GlobalProductCode>
				<LocalProductCode>Q</LocalProductCode>
				<ProductShortName>MEDICAL EXPRESS</ProductShortName>
				<LocalProductName>MEDICAL EXPRESS NONDOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>Y</POfferedCustAgreement>
				<TransInd>N</TransInd>
				<PickupDate>2013-08-02</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>7</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>4</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-13</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>5</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>2</DestinationDayOfWeekNum>
				<QtdShpExChrg>
					<SpecialServiceType>OO</SpecialServiceType>
					<LocalServiceType>OO</LocalServiceType>
					<GlobalServiceName>REMOTE AREA DELIVERY</GlobalServiceName>
					<LocalServiceTypeName>REMOTE AREA DELIVERY</LocalServiceTypeName>
					<ChargeCodeType>SCH</ChargeCodeType>
				</QtdShpExChrg>
			</QtdShp>
		</BkgDetails>
		<Srvs>
			<Srv>
				<GlobalProductCode>8</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>8</LocalProductCode>
					<ProductShortName>EXPRESS EASY</ProductShortName>
					<LocalProductName>EXPRESS EASY NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>Y</POfferedCustAgreement>
					<TransInd>N</TransInd>
				</MrkSrv>
				<MrkSrv>
					<LocalServiceType>OO</LocalServiceType>
					<GlobalServiceName>REMOTE AREA DELIVERY</GlobalServiceName>
					<LocalServiceTypeName>REMOTE AREA DELIVERY</LocalServiceTypeName>
					<ChargeCodeType>SCH</ChargeCodeType>
					<MrkSrvInd>N</MrkSrvInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>P</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>P</LocalProductCode>
					<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
					<LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
				<MrkSrv>
					<LocalServiceType>OO</LocalServiceType>
					<GlobalServiceName>REMOTE AREA DELIVERY</GlobalServiceName>
					<LocalServiceTypeName>REMOTE AREA DELIVERY</LocalServiceTypeName>
					<ChargeCodeType>SCH</ChargeCodeType>
					<MrkSrvInd>N</MrkSrvInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>Q</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>Q</LocalProductCode>
					<ProductShortName>MEDICAL EXPRESS</ProductShortName>
					<LocalProductName>MEDICAL EXPRESS NONDOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>Y</POfferedCustAgreement>
					<TransInd>N</TransInd>
				</MrkSrv>
				<MrkSrv>
					<LocalServiceType>OO</LocalServiceType>
					<GlobalServiceName>REMOTE AREA DELIVERY</GlobalServiceName>
					<LocalServiceTypeName>REMOTE AREA DELIVERY</LocalServiceTypeName>
					<ChargeCodeType>SCH</ChargeCodeType>
					<MrkSrvInd>N</MrkSrvInd>
				</MrkSrv>
			</Srv>
		</Srvs>
	</GetQuoteResponse>
</res:DCTResponse>

Here are returned 3 services, but the service NONDOC EXPRESS WORLDWIDE (ProductCode P) also contains the evaluation of the shipping:

<TotalAmount>98.000</TotalAmount>

So if you ship to a country outside the EU we get a quote otherwise you get none.

For testing with the XML-PI DHL I recommend you use this url:
http://xmlpitest-ea.dhl.com/serviceval/jsps/main/Main_menu.jsp
Here you go in the Routing-> XMLPI and insert in the text area the XML content of your request.

If we now take the previous request to the French destination and set to N the flag isDutiable and look at the response you get:

<?xml version="1.0"?>
<res:DCTResponse xmlns:res="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-Response.xsd">
	<GetQuoteResponse>
		<Response>
			<ServiceHeader>
				<MessageTime>2013-08-09T17:08:03.393+01:00</MessageTime>
				<SiteID>xxxxxxxxxxxxx</SiteID>
			</ServiceHeader>
		</Response>
		<BkgDetails>
			<OriginServiceArea>
				<FacilityCode>MAX</FacilityCode>
				<ServiceAreaCode>AOI</ServiceAreaCode>
			</OriginServiceArea>
			<DestinationServiceArea>
				<FacilityCode>PSO</FacilityCode>
				<ServiceAreaCode>CDG</ServiceAreaCode>
			</DestinationServiceArea>
			<QtdShp>
				<GlobalProductCode>K</GlobalProductCode>
				<LocalProductCode>K</LocalProductCode>
				<ProductShortName>EXPRESS 9:00</ProductShortName>
				<LocalProductName>EXPRESS 9:00 DOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT9H</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>T</GlobalProductCode>
				<LocalProductCode>T</LocalProductCode>
				<ProductShortName>EXPRESS 12:00</ProductShortName>
				<LocalProductName>EXPRESS 12:00 DOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT12H</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>7</GlobalProductCode>
				<LocalProductCode>7</LocalProductCode>
				<ProductShortName>EXPRESS EASY</ProductShortName>
				<LocalProductName>EXPRESS EASY DOC</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>Y</POfferedCustAgreement>
				<TransInd>N</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
			</QtdShp>
			<QtdShp>
				<GlobalProductCode>U</GlobalProductCode>
				<LocalProductCode>U</LocalProductCode>
				<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
				<LocalProductName>EXPRESS WORLDWIDE EU</LocalProductName>
				<NetworkTypeCode>TD</NetworkTypeCode>
				<POfferedCustAgreement>N</POfferedCustAgreement>
				<TransInd>Y</TransInd>
				<PickupDate>2013-08-01</PickupDate>
				<PickupCutoffTime>PT16H45M</PickupCutoffTime>
				<BookingTime>PT15H45M</BookingTime>
				<CurrencyCode>EUR</CurrencyCode>
				<ExchangeRate>1.000000</ExchangeRate>
				<WeightCharge>62.000</WeightCharge>
				<WeightChargeTax>0.000</WeightChargeTax>
				<TotalTransitDays>1</TotalTransitDays>
				<PickupPostalLocAddDays>0</PickupPostalLocAddDays>
				<DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
				<PickupNonDHLCourierCode/>
				<DeliveryNonDHLCourierCode/>
				<DeliveryDate>2013-08-02</DeliveryDate>
				<DeliveryTime>PT23H59M</DeliveryTime>
				<DimensionalWeight>1.700</DimensionalWeight>
				<WeightUnit>KG</WeightUnit>
				<PickupDayOfWeekNum>4</PickupDayOfWeekNum>
				<DestinationDayOfWeekNum>5</DestinationDayOfWeekNum>
				<PricingDate>2013-08-09</PricingDate>
				<ShippingCharge>62.000</ShippingCharge>
				<TotalTaxAmount>0.000</TotalTaxAmount>
				<QtdSInAdCur>
					<CurrencyCode>EUR</CurrencyCode>
					<CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
					<WeightCharge>62.000</WeightCharge>
					<TotalAmount>62.000</TotalAmount>
					<TotalTaxAmount>0.000</TotalTaxAmount>
					<WeightChargeTax>0.000</WeightChargeTax>
					<WeightChargeTaxDet>
						<TaxTypeRate>0.000</TaxTypeRate>
						<TaxTypeCode>VAT</TaxTypeCode>
						<WeightChargeTax>0.000</WeightChargeTax>
						<BaseAmt>62.000</BaseAmt>
					</WeightChargeTaxDet>
				</QtdSInAdCur>
				<QtdSInAdCur>
					<CurrencyCode>EUR</CurrencyCode>
					<CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
					<WeightCharge>62.000</WeightCharge>
					<TotalAmount>62.000</TotalAmount>
					<TotalTaxAmount>0.000</TotalTaxAmount>
					<WeightChargeTax>0.000</WeightChargeTax>
					<WeightChargeTaxDet>
						<TaxTypeRate>0.000</TaxTypeRate>
						<TaxTypeCode>VAT</TaxTypeCode>
						<WeightChargeTax>0.000</WeightChargeTax>
						<BaseAmt>62.000</BaseAmt>
					</WeightChargeTaxDet>
				</QtdSInAdCur>
				<QtdSInAdCur>
					<CurrencyCode>USD</CurrencyCode>
					<CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
					<WeightCharge>62.000</WeightCharge>
					<TotalAmount>62.000</TotalAmount>
					<TotalTaxAmount>0.000</TotalTaxAmount>
					<WeightChargeTax>0.000</WeightChargeTax>
					<WeightChargeTaxDet>
						<TaxTypeRate>0.000</TaxTypeRate>
						<TaxTypeCode>VAT</TaxTypeCode>
						<WeightChargeTax>0.000</WeightChargeTax>
						<BaseAmt>62.000</BaseAmt>
					</WeightChargeTaxDet>
				</QtdSInAdCur>
				<WeightChargeTaxDet>
					<TaxTypeRate>0.000</TaxTypeRate>
					<TaxTypeCode>VAT</TaxTypeCode>
					<WeightChargeTax>0.000</WeightChargeTax>
					<BaseAmt>62.000</BaseAmt>
				</WeightChargeTaxDet>
			</QtdShp>
		</BkgDetails>
		<Srvs>
			<Srv>
				<GlobalProductCode>K</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>K</LocalProductCode>
					<ProductShortName>EXPRESS 9:00</ProductShortName>
					<LocalProductName>EXPRESS 9:00 DOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>T</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>T</LocalProductCode>
					<ProductShortName>EXPRESS 12:00</ProductShortName>
					<LocalProductName>EXPRESS 12:00 DOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>7</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>7</LocalProductCode>
					<ProductShortName>EXPRESS EASY</ProductShortName>
					<LocalProductName>EXPRESS EASY DOC</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>Y</POfferedCustAgreement>
					<TransInd>N</TransInd>
				</MrkSrv>
			</Srv>
			<Srv>
				<GlobalProductCode>U</GlobalProductCode>
				<MrkSrv>
					<LocalProductCode>U</LocalProductCode>
					<ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
					<LocalProductName>EXPRESS WORLDWIDE EU</LocalProductName>
					<NetworkTypeCode>TD</NetworkTypeCode>
					<POfferedCustAgreement>N</POfferedCustAgreement>
					<TransInd>Y</TransInd>
				</MrkSrv>
			</Srv>
		</Srvs>
	</GetQuoteResponse>
</res:DCTResponse>

It returns the service EXPRESS WORLDWIDE EU (ProductCode U) with a quotation.

This seems to make sense because among the EU countries for which there is no custom, isDutiable should be set to N.

The problem is that Magento 1.7.0.2 sets this flag to Y.

In the file app\code\core\Mage\Use\Model\Shipping\Carrier\DHL\International.php there is a not function to check if the shipment takes place between EU countries so I added

	protected function _checkEuShipping($origCountryCode, $destCountryCode)
	{
		$this->_isEuShipping = false;
		$eu_countries = Mage::getStoreConfig('general/country/eu_countries');
		$eu_countries_array = explode(',',$eu_countries);
		if(in_array($origCountryCode, $eu_countries_array) && in_array($destCountryCode, $eu_countries_array)){
            $this->_isEuShipping = true;
		}

		return $this->_isEuShipping;
	}
}

This function returns true if both the source and the destination are European community countries: the list is handled in the section Country of the General configuration of Magento.

This function also sets the variable $_isEuShipping declared at the beginning of the file.

protected $ _isEuShipping = false;

Now this variable should be used to understand whether or not you have to set the isDutiable flag and select the method appropriate to do doc/nondoc if the shipment and intra-EU.

See the complete file attached to this post: International.php (859)

To preserve the structure of Magento put that file under app\code\local\Mage\Use\Model\Shipping\Carrier\DHL\International.php eventually creating the directory structure.

An alternative method, but I have not tested, might be at what provides the only change of the function


    protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
    {
        $this->_isDomestic = false;

        $origCountry = (string)$this->getCountryParams($origCountryCode)->name;
        $destCountry = (string)$this->getCountryParams($destCountryCode)->name;
        $isDomestic = (string)$this->getCountryParams($destCountryCode)->domestic;

        if ($origCountry == $destCountry && $isDomestic) {
            $this->_isDomestic = true;
        }

        return $this->_isDomestic;
    }

in this way:

    protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
    {
        $this->_isDomestic = false;

        $origCountry = (string)$this->getCountryParams($origCountryCode)->name;
        $destCountry = (string)$this->getCountryParams($destCountryCode)->name;
        $isDomesticOrig = (string)$this->getCountryParams($origCountryCode)->domestic;
		$isDomesticDest = (string)$this->getCountryParams($destCountryCode)->domestic;

        if (($origCountry == $destCountry) || ($isDomesticOrig && $isDomesticDest)) {
            $this->_isDomestic = true;
        }

        return $this->_isDomestic;
    }

Attached file: International.php (859)

3 pensieri su “Problems with DHL module in Magento 1.7.0.2 (UE countries)

  1. Most internet marketers try to uuse SEO, forum marketing, article marketing and other forms of
    online marketing which has made the world of online
    marketing very packed out and hhard to tap into. But then again, having a
    website will give you an esge over the others who don’t have because this will give you
    better exposure. They will receive tremendous exposure which will help them boost their presence.

  2. Есть такая услуга – добровольное медицинское обслуживание .
    Она предполагает, что пациент вносит небольшую сумму за то, что посещает врачей весь год БЕСПЛАТНО.
    Однако опросы показывают, что лишь 4% жителей Санкт-Петербурга знают об этом.
    Почему?
    Потому что клиникам намного выгодней брать плату за каждый визит.
    А если честный врач попытается рассказать про добровольное медицинское обслуживание клиенту – это сулит ему увольнением.
    Информация о ДМО уже вызвала много возмущений, сразу после того как информацию об услуге распространил один врач.
    Его уволили , после того, как он предложил ДМО своему пациенту.
    Самое ужасное, что информация по ДМО присутствуют в открытом доступе, просто находили на эту информацию только случайные люди.
    Как отстоять свои права?
    О правилах предоставления такой услуги и обязанностях частных клиник можно узнать, сделав запрос в Яндексе: “добровольное медицинское обслуживание”.
    И именно обслуживание, а не страхование.

    34j5c6h86

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *