public function testSetWsdlGetWsdlWithSoapClient() { $wsdl = 'http://example.com/somewhere.wsdl'; $mailMerge = new MailMerge(); $soapClient = new \Zend\Soap\Client(); $soapClient->setWsdl($wsdl); $this->assertInstanceOf('ZendService\\LiveDocx\\MailMerge', $mailMerge->setSoapClient($soapClient)); $this->assertEquals($wsdl, $mailMerge->getWsdl()); unset($mailMerge); }
$errorMessage = $e->getMessage(); } if (is_null($errorMessage)) { $result = TEST_PASS; } else { $result = TEST_FAIL; $failed = true; } Helper::printLineToc($counter, sprintf('Logging into LiveDocx Free (%01.2fs)', $duration), $result); $counter++; // ----------------------------------------------------------------------------- if (defined('DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_USERNAME') && false !== DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_USERNAME) { $mailMerge = new MailMerge(); $mailMerge->setUsername(DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_USERNAME)->setService(MailMerge::SERVICE_PREMIUM); $microtime = microtime(true); $results = @file_get_contents($mailMerge->getWsdl()); if (false != $results) { $duration = microtime(true) - $microtime; $result = TEST_PASS; } else { $duration = -1; $result = TEST_FAIL; $failed = true; } Helper::printLineToc($counter, sprintf('Checking LiveDocx Premium WSDL (%01.2fs)', $duration), $result); $counter++; unset($mailMerge); } // ----------------------------------------------------------------------------- if (defined('DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_USERNAME') && defined('DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_PASSWORD') && false !== DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_USERNAME && false !== DEMOS_ZENDSERVICE_LIVEDOCX_PREMIUM_PASSWORD) { $result = TEST_PASS;
<?php include_once realpath('../../../../Bootstrap.php'); use ZendService\LiveDocx\DemoHelper as Helper; use ZendService\LiveDocx\MailMerge; Helper::printLine(PHP_EOL . 'Using LiveDocx Fully Licensed' . PHP_EOL . PHP_EOL . 'This sample application illustrates how to use the Zend Framework LiveDocx component with the LiveDocx running in your own network.' . PHP_EOL . PHP_EOL); // ----------------------------------------------------------------------------- // Pass login credentials using set methods $mailMerge = new MailMerge(); $mailMerge->setUsername('your-username')->setPassword('your-password')->setWsdl('http://api.example.com/2.1/mailmerge.asmx?wsdl'); // set the WSDL of your locally installed, // LiveDocx Fully Licensed server here $mailMerge->getTemplateFormats(); // then call methods as usual printf('Username : %s%sPassword : %s%s WSDL : %s%s%s', $mailMerge->getUsername(), PHP_EOL, $mailMerge->getPassword(), PHP_EOL, $mailMerge->getWsdl(), PHP_EOL, PHP_EOL); unset($mailMerge); // ----------------------------------------------------------------------------- // Pass login credentials using constructor $mailMerge = new MailMerge(); $mailMerge = new MailMerge(array('username' => 'your-username', 'password' => 'your-password', 'wsdl' => 'http://api.example.com/2.1/mailmerge.asmx?wsdl')); // set the WSDL of your // LiveDocx Fully Licensed server here $mailMerge->getTemplateFormats(); // then call methods as usual printf('Username : %s%sPassword : %s%s WSDL : %s%s%s', $mailMerge->getUsername(), PHP_EOL, $mailMerge->getPassword(), PHP_EOL, $mailMerge->getWsdl(), PHP_EOL, PHP_EOL); unset($mailMerge); // -----------------------------------------------------------------------------