<?php
/**
 * File for class DhlApiServiceCreate
 * @package DhlApi
 * @subpackage Services
 * @author WsdlToPhp Team <contact@wsdltophp.com>
 * @version 20140325-01
 * @date 2015-02-05
 */
/**
 * This class stands for DhlApiServiceCreate originally named Create
 * @package DhlApi
 * @subpackage Services
 * @author WsdlToPhp Team <contact@wsdltophp.com>
 * @version 20140325-01
 * @date 2015-02-05
 */
class DhlApiServiceCreate extends DhlApiWsdlClass
{
    /**
     * Method to call the operation originally named createShipments
     * Documentation : Definiowanie przesyłek w systemie DHL
     * @uses DhlApiWsdlClass::getSoapClient()
     * @uses DhlApiWsdlClass::setResult()
     * @uses DhlApiWsdlClass::saveLastError()
     * @param DhlApiStructCreateShipments $_dhlApiStructCreateShipments
     * @return DhlApiStructCreateShipmentsResponse
     */
    public function createShipments(DhlApiStructCreateShipments $_dhlApiStructCreateShipments)
    {
        try
        {
            return $this->setResult(self::getSoapClient()->createShipments($_dhlApiStructCreateShipments));
        }
        catch(SoapFault $soapFault)
        {
            return !$this->saveLastError(__METHOD__,$soapFault);
        }
    }
    /**
     * Method to call the operation originally named createShipment
     * Documentation : Definiowanie przesyłki w systemie DHL - metoda agregująca
     * @uses DhlApiWsdlClass::getSoapClient()
     * @uses DhlApiWsdlClass::setResult()
     * @uses DhlApiWsdlClass::saveLastError()
     * @param DhlApiStructCreateShipment $_dhlApiStructCreateShipment
     * @return DhlApiStructCreateShipmentResponse
     */
    public function createShipment(DhlApiStructCreateShipment $_dhlApiStructCreateShipment)
    {
        try
        {
            return $this->setResult(self::getSoapClient()->createShipment($_dhlApiStructCreateShipment));
        }
        catch(SoapFault $soapFault)
        {
            return !$this->saveLastError(__METHOD__,$soapFault);
        }
    }
    /**
     * Returns the result
     * @see DhlApiWsdlClass::getResult()
     * @return DhlApiStructCreateShipmentResponse|DhlApiStructCreateShipmentsResponse
     */
    public function getResult()
    {
        return parent::getResult();
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
