Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // file: application/models/UpperLower.php
- class Application_Model_UpperLower
- {
- /**
- * Converts a string to all upper strings
- *
- * @param string $string
- * @return string
- */
- public function convertUpper($string)
- {
- return strtoupper($string);
- }
- /**
- * Converts a string to all lower strings
- *
- * @param string $string
- * @return string
- */
- public function convertLower($string)
- {
- return strtolower($string);
- }
- }
- <?php
- // file: application/controllers/SoapController.php
- class SoapController extends Zend_Controller_Action
- {
- public function init()
- {
- }
- public function indexAction()
- {
- $this->_helper->viewRenderer->setNoRender(true);
- if(isset($_GET['wsdl'])) {
- $autodiscover = new Zend_Soap_AutoDiscover();
- $autodiscover->setClass('Application_Model_UpperLower');
- $autodiscover->handle();
- } else {
- // pointing to the current file here
- $soap = new Zend_Soap_Server("http://zftraining.osx/soap/index?wsdl");
- $soap->setClass('Application_Model_UpperLower');
- $soap->handle();
- }
- }
- public function convertAction()
- {
- $string = $this->getRequest()->getParam('string', 'AbcXyz');
- $client = new Zend_Soap_Client('http://zftraining.osx/soap/index?wsdl');
- $this->view->string = $string;
- $this->view->upper = $client->convertUpper($string);
- $this->view->lower = $client->convertLower($string);
- }
- }
- <?php // file: application/views/scripts/soap/convert.phtml ?>
- <dl>
- <dt>String: <?php echo $this->escape($this->string) ?></dt>
- <dd>Upper: <?php echo $this->escape($this->upper) ?></dd>
- <dd>Lower: <?php echo $this->escape($this->lower) ?></dd>
- </dl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement