public function upload()
    {
        try {
            $templatecontent = $this->getBase64Contents();
            $filename        = basename($this->getName());
        } catch ( FileExistException $ex ) {
            throw new FileExistException('Template file does not exist or is not readable' , $ex);
        }

        try {
            $this->getSoapClient()->UploadTemplate([
                'template' => $templatecontent ,
                'filename' => $filename ,
            ]);

            $remoteTemplate = new Remote($this->getSoapClient());
            $remoteTemplate->setName($this->getName());

            return $remoteTemplate;
        } catch ( SoapException $ex ) {
            throw new UploadException('Error while uploading the template' , $ex);
        }
    }