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'>
- Obtain weather forecast data through the open WebService
- 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 );
?>
- Simple implementation of soapserver and soapclient
- 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 ');
?>
- 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.