首頁  >  文章  >  後端開發  >  zend framework 提供的webservices解决思路

zend framework 提供的webservices解决思路

WBOY
WBOY原創
2016-06-13 10:05:47767瀏覽

zend framework 提供的webservices
谁有这样的完整的例子。用到Zend_Soap_Server 等zend framework提供的soap扩展的。
想学一下,哪位大侠给提供一些资料,例子的更好啊。最好是那种能运行的简单小例子,谢谢啦

------解决方案--------------------
application/controllers/WebServiceController.php

PHP code
<?phpclass WebServiceController extends Zend_Controller_Action {    public function init() {        $this->_helper->viewRenderer->setNoRender();    }        public function indexAction() {        if (isset($_GET['wsdl'])) {            $autodiscover = new Zend_Soap_AutoDiscover();                $autodiscover->setClass('Service_Helloworld');            $autodiscover->handle();        } else {            $soap = new Zend_Soap_Server("http://zf-demo.localhost/WebService/index/?wsdl");            $soap->setClass('Service_Helloworld');            $soap->handle();        }    }        public function testAction() {        $params = array(            'name' => 'tom'        );                $client = new SoapClient("http://zf-demo.localhost/WebService/index/?wsdl", array('trace' => 1));        echo $client->__soapCall('sayHello', $params);    }    }<br><font color="#e78608">------解决方案--------------------</font><br>
探讨

高手们 还有吗?

------解决方案--------------------
zend framework 英文版的用不习惯,不知道有没有汉化的,在此之前,我一直用的是EclipsePHP Studio ,还可以!!
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn