hosted-licensed.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/php
  2. <?php
  3. require_once dirname(__FILE__) . '/../../common.php';
  4. system('clear');
  5. print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
  6. PHP_EOL . 'Using Hosted Solution and Fully-Licensed Servers' .
  7. PHP_EOL .
  8. PHP_EOL . 'This sample application illustrates how to use Zend_Service_LiveDocx_MailMerge with hosted and fully-licensed LiveDocx servers, by specifying an alternative SOAP client (must be instance of Zend_Soap_Client).' .
  9. PHP_EOL .
  10. PHP_EOL)
  11. );
  12. $mySoapClient = new Zend_Soap_Client(
  13. 'https://api.example.com/1.2/mailmerge.asmx?WSDL'
  14. );
  15. $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
  16. $phpLiveDocx->setSoapClient($mySoapClient);
  17. $phpLiveDocx->setUsername(Demos_Zend_Service_LiveDocx_Helper::USERNAME)
  18. ->setPassword(Demos_Zend_Service_LiveDocx_Helper::PASSWORD);
  19. $phpLiveDocx->getTemplateFormats(); // then call methods as usual
  20. printf('Username : %s%sPassword : %s%s WSDL : %s%s%s',
  21. $phpLiveDocx->getUsername(),
  22. PHP_EOL,
  23. $phpLiveDocx->getPassword(),
  24. PHP_EOL,
  25. $phpLiveDocx->getSoapClient()->getWsdl(),
  26. PHP_EOL,
  27. PHP_EOL
  28. );
  29. unset($phpLiveDocx, $mySoapClient);