Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/admin/kurierinpost/GetLabelByFormat.php |
<?php
$client = new SoapClient('http://api.inpost.opennet.pl/api.asmx?WSDL', array('trace' => 1));
//$format = "PNG";
$format = "PDFA4Consolidated";
$params = array(
"token" => array(
"UserName" => 'demo',
"Password" => 'demo'
),
"request" => array(
"PackageNo" => array(
'523000019905500000004108',
'523000019905500000004117'
),
"MimeFormat" => $format
)
);
echo '<pre>'.print_r($params, true).'</pre>';
$response = $client->__soapCall("GetLabelByFormat", array($params));
$shippingLabelContent = $response->GetLabelByFormatResult->LabelData->Label->MimeData;
$response->GetLabelByFormatResult->LabelData->Label->MimeData = "[" . strlen($shippingLabelContent) . "]"; // Aby w logu nie było śmieci
file_put_contents('test6.pdf', $shippingLabelContent);
echo '<pre>'.print_r($response, true).'</pre>';
echo $client->__getLastRequest();
?>