zend framework 提供的webservices解决思路

WBOY
풀어 주다: 2016-06-13 13:49:55
원래의
843명이 탐색했습니다.

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

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

PHP code

<?php class 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 ,还可以!!
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!