Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/admin/gls.php
<?php
$hClient = new SoapClient( 'https://adeplus.gls-poland.com/adeplus/pm1/ade_webapi2.php?wsdl' ); 
   
$oCredit = new stdClass();
$oCredit->user_name = '54002596.api';
$oCredit->user_password = '14qbW@Qb';     
     
$oClient = $hClient->adeLogin( $oCredit ); 
$szSession = $oClient->return->session;

//echo $szSession;

$oSess = new stdClass();
$oSess->session = $szSession;
$oClient = $hClient->adeProfile_GetIDs( $oSess );     

    // ustaw profil
	$tablicaProfila= new stdClass();
	$tablicaProfila->session=$szSession;
	$tablicaProfila->id='45832';
    $aktualnyProfil=$hClient->adeProfile_Change($tablicaProfila);


$oCons = new stdClass();    
$oCons->session = $szSession;
$oCons->consign_prep_data = new stdClass();
$oCons->consign_prep_data->rname1 = 'Pan (1)';
$oCons->consign_prep_data->rname2 = 'Jan (2)';
$oCons->consign_prep_data->rname3 = 'Kowalski (3)';
    
$oCons->consign_prep_data->rcountry = 'PL';
$oCons->consign_prep_data->rzipcode = '00-950';
$oCons->consign_prep_data->rcity = 'Warszawa';
$oCons->consign_prep_data->rstreet = 'ul. Mordor 15';
    
$oCons->consign_prep_data->rphone = '(48) 000-000-000';
$oCons->consign_prep_data->rcontact = 'test@domain.eu';
    
$oCons->consign_prep_data->references = 'przez api '.Date('H:i:s d.m.Y');
$oCons->consign_prep_data->notes = 'Dodane Administratora prolabel.pl';    
$oCons->consign_prep_data->weight = 1.2; 
$oCons->consign_prep_data->quantity = 1; // overwrited by ParcelsArray



$oCons->consign_prep_data->parcels = new stdClass();
    
$oParcel = new stdClass();
$oParcel->weight = '1';    
$oCons->consign_prep_data->parcels->items[] = $oParcel;

  

    
$oClient = $hClient->adePreparingBox_Insert( $oCons );  

print_r($oClient);


?>