Introduction to php + soap: 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'> use the open webservice to obtain weather forecast data
$ 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 ('thecitycode' => 2210 )));
Var_dump ($ we );
?>
Simple implementation of soapserver and soapclient
Soapclient
/*
* 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 ');
?>
Soapserver writes
/*
* 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.