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