Я пытаюсь воспользоваться службой DHL XML для запроса получения. Но после присвоения значения и использования следующего кода я получаю сообщение об ошибке Error108System Unavailable. Как я могу решить эту проблему. Это из-за ошибки в коде или сервер не отвечает.
request_pickup.php
<?php
$xml = file_get_contents('post_xml.xml');
$url = 'https://xmlpitest-ea.dhl.com/XMLShippingServlet/';$post_data = array(
"xml" => $xml,
);
$stream_options = array(
'http' => array(
'method' => 'POST',
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'content' => http_build_query($post_data),
),
);
$context = stream_context_create($stream_options);
$response = file_get_contents($url, null, $context);
var_dump($response);
А другой XML-файл
<?xml version="1.0" encoding="UTF-8"?>
<req:BookPURequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com
book-pickup-global-req.xsd" schemaVersion="1.0">
<Request>
<ServiceHeader>
<MessageTime>2013-08-03T09:30:47-05:00</MessageTime>
<MessageReference>Esteemed Courier Service of DHL</MessageReference>
<SiteID>xmlPRONTOEQ</SiteID>
<Password>g8xicHyl5r</Password>
</ServiceHeader>
</Request>
<RegionCode>AM</RegionCode>
<Requestor>
<AccountType>D</AccountType>
<RequestorContact>
<PersonName>Rikhil</PersonName>
<Phone>23162</Phone>
</RequestorContact>
</Requestor>
<Place>
<LocationType>B</LocationType>
<CompanyName>String</CompanyName>
<Address1>String</Address1>
<Address2>norfolk+st</Address2>
<PackageLocation>String</PackageLocation>
<City>String</City>
<StateCode>CA</StateCode>
<DivisionName>sd</DivisionName>
<CountryCode>BR</CountryCode>
<PostalCode>66810</PostalCode>
</Place>
<Pickup>
<PickupDate>2013-10-19</PickupDate>
<ReadyByTime>10:20</ReadyByTime>
<CloseTime>09:20</CloseTime>
<AfterHoursClosingTime>11:20</AfterHoursClosingTime>
<AfterHoursLocation>String</AfterHoursLocation>
<Pieces>2</Pieces>
<weight>
<Weight>20</Weight>
<WeightUnit>L</WeightUnit>
</weight>
</Pickup>
<PickupContact>
<PersonName>Subhayu</PersonName>
<Phone>4801313131</Phone>
</PickupContact>
<ShipmentDetails>
<AccountType>C</AccountType>
<AccountNumber>851624480</AccountNumber>
<ChargeCard>
<ChargeCardNo>232311212312311</ChargeCardNo>
<ChargeCardType>VI</ChargeCardType>
<ChargeCardExpiryDate>1206</ChargeCardExpiryDate>
</ChargeCard>
<BillToAccountNumber>100000000</BillToAccountNumber>
<AWBNumber>7520067111</AWBNumber>
<NumberOfPieces>1</NumberOfPieces>
<Weight>10</Weight>
<WeightUnit>L</WeightUnit>
<GlobalProductCode>D</GlobalProductCode>
<DoorTo>DD</DoorTo>
<DimensionUnit>I</DimensionUnit>
<InsuredAmount>999999.99</InsuredAmount>
<InsuredCurrencyCode>USD</InsuredCurrencyCode>
<Pieces>
<Weight>10</Weight>
<Width>2</Width>
<Height>2</Height>
<Depth>2</Depth>
</Pieces>
<SpecialService>S</SpecialService>
<SpecialService>I</SpecialService>
</ShipmentDetails>
<ShipmentDetails>
<AccountType>D</AccountType>
<AccountNumber>846737292</AccountNumber>
<BillToAccountNumber>846737292</BillToAccountNumber>
<AWBNumber>7520067111</AWBNumber>
<NumberOfPieces>1</NumberOfPieces>
<Weight>10</Weight>
<WeightUnit>L</WeightUnit>
<GlobalProductCode>D</GlobalProductCode>
<DoorTo>DD</DoorTo>
<DimensionUnit>I</DimensionUnit>
<InsuredAmount>50</InsuredAmount>
<InsuredCurrencyCode>USD</InsuredCurrencyCode>
<Pieces>
<Weight>10</Weight>
<Width>2</Width>
<Height>2</Height>
<Depth>2</Depth>
</Pieces>
<SpecialService>S</SpecialService>
</ShipmentDetails>
</req:BookPURequest>
Задача ещё не решена.
Других решений пока нет …