php+soap 入門

來源:互聯網
上載者:User

簡介:這是php+soap 入門的詳細頁面,介紹了和php,有關的知識、技巧、經驗,和一些php源碼等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=335098' scrolling='no'>

  1. 通過開放的webservice擷取天氣預報資料
  2. 代碼 <?php
    $c = new SoapClient( 'http://www.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl',
    array( 'trace' => true, 'exceptions' => true ) );//var_dump( $c->__getFunctions() );
    //var_dump( $c->__getTypes() );
    //不需要參數的情況
    $pr =$c->getRegionProvince();
    //var_dump( $pr->getRegionProvinceResult->string );
    //帶有參數的情況
    $scs = $c->getSupportCityString( array( 'theRegionCode' => '福建' ) );
    var_dump( $scs->getSupportCityStringResult->string );
    var_dump($scs);
    //也可以這樣做
    $we = $c->__call('getWeather', array( array( 'theCityCode' => 2210) ) );
    var_dump( $we );

    ?>

  3. soapserver和soapclient簡單實現
  4. soapclient <?php
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    $ss = new SoapClient( null, array( 'uri' => 'http://zendstudio.net', 'location' => 'http://localhost/soaptest/soapserver.php' ) );
    $header = new SoapHeader( 'zendHeader', 'mmcYY', '12345678' );
    $ss->__setSoapHeaders( $header );
    echo $ss->im8( 'gently' );

    ?>

  5. soapserver 寫道<?php
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    $ss = new SoapServer( null, array( 'uri' => 'http://zendstudio.net' ) );
    $ss->setClass( 't', '參數1', '參數2' );
    $ss->handle();
    //$request = file_get_contents( 'php://input' );
    //file_put_contents( 'request.txt', $request );
    class t{

    function __construct( $p1, $p2 ){

    }

    function im8( $g ){
    return 'OK----'. $g;
    }

    }

    ?>

“php+soap 入門”的更多相關文章 》

愛J2EE關注Java邁克爾傑克遜視頻站JSON線上工具

http://biancheng.dnbcw.info/php/335098.html pageNo:10

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.