PHP + soap

Source: Internet
Author: User

Introduction: This is a detailed page for getting started with PHP + soap. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 335098 'rolling = 'no'>

  1. Obtain weather forecast data through the open WebService
  2. Code<? PHP
    $ C = new soapclient ('HTTP: // www.webxml.com.cn/webservices/weatherws.asmx? WSDL ',
    Array ('track' => true, 'exception' => true); // var_dump ($ C->__ getfunctions ());
    // Var_dump ($ C->__ gettypes ());
    // No parameters are required.
    $ Pr = $ C-> getregionprovince ();
    // Var_dump ($ pr-> getregionprovinceresult-> string );
    // With Parameters
    $ SCS = $ C-> getsupportcitystring (Array ('theregioncode' => 'fujian '));
    Var_dump ($ SCS-> getsupportcitystringresult-> string );
    Var_dump ($ SCS );
    // You can also do this.
    $ We = $ C->__ call ('getwither', array (Array ('thecitycode' => 2210 )));
    Var_dump ($ we );

    ?>

  3. Simple implementation of soapserver and soapclient
  4. Soapclient <? PHP
    /*
    * To change this template, choose tools | templates
    * And open the template in the editor.
    */
    $ Ss = new soapclient (null, array ('uris '=> 'HTTP: // zendstudio.net', 'location' => 'HTTP: // localhost/soaptest/soapserver. PHP '));
    $ Header = new soapheader ('zendheader', 'mmcyy', '123 ');
    $ SS->__ setsoapheaders ($ header );
    Echo $ SS-> im8 ('cliently ');

    ?>

  5. The soapserver writes <? 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', 'parameter 1', 'parameter 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;
    }

    }

    ?>

More articles about PHP + soap

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/335098.html pageno: 10.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.