public function testWsdlHttpFileNotFound() { $this->setExpectedException('ZendService\\LiveDocx\\Exception\\RuntimeException'); $mailMerge = new MailMerge(); $mailMerge->setUsername(TESTS_ZENDSERVICE_LIVEDOCX_FREE_USERNAME)->setPassword(TESTS_ZENDSERVICE_LIVEDOCX_FREE_PASSWORD)->setWsdl('http://www.livedocx.com/file-not-found.wsdl'); $mailMerge->listTemplates(); unset($mailMerge); }
<?php include_once realpath('../../../../Bootstrap.php'); use ZendService\LiveDocx\DemoHelper as Helper; use ZendService\LiveDocx\MailMerge; Helper::printLine(PHP_EOL . 'Downloading Remotely Stored Templates' . PHP_EOL . PHP_EOL); $mailMerge = new MailMerge(); $mailMerge->setUsername(DEMOS_ZENDSERVICE_LIVEDOCX_FREE_USERNAME)->setPassword(DEMOS_ZENDSERVICE_LIVEDOCX_FREE_PASSWORD)->setService(MailMerge::SERVICE_FREE); // for LiveDocx Premium, use MailMerge::SERVICE_PREMIUM $counter = 1; foreach ($mailMerge->listTemplates() as $result) { printf('%d) %s', $counter, $result['filename']); $template = $mailMerge->downloadTemplate($result['filename']); file_put_contents('downloaded-' . $result['filename'], $template); print ' - DOWNLOADED.' . PHP_EOL; $counter++; } print PHP_EOL; unset($mailMerge);
<?php include_once realpath('../../../../Bootstrap.php'); use ZendService\LiveDocx\DemoHelper as Helper; use ZendService\LiveDocx\MailMerge; Helper::printLine(PHP_EOL . 'Remotely Stored Templates' . PHP_EOL . PHP_EOL . 'The following templates are currently stored on the LiveDocx server:' . PHP_EOL . PHP_EOL); $mailMerge = new MailMerge(); $mailMerge->setUsername(DEMOS_ZENDSERVICE_LIVEDOCX_FREE_USERNAME)->setPassword(DEMOS_ZENDSERVICE_LIVEDOCX_FREE_PASSWORD)->setService(MailMerge::SERVICE_FREE); // for LiveDocx Premium, use MailMerge::SERVICE_PREMIUM print Helper::listDecorator($mailMerge->listTemplates()); unset($mailMerge);