Chinaunix
标题:
php5的soap怎么用
[打印本页]
作者:
轩辕砍刀
时间:
2007-04-26 10:34
标题:
php5的soap怎么用
想用php5的soap库调.net的web service,请大大们给个详细简单的例子~
作者:
kongge_1
时间:
2007-04-27 17:32
标题:
.net的web service没有,google的到做过
作了一个调用google的web service代码如下:
$query = '上海';
$key = 'CMDusl5QFHIEnwCvJKbCPgFOOMxzoiJy';
$num = 10;
//$soapoptions = array('namespace' => 'urn:GoogleSearch',
//'trace' => 0);
$soap_client= new SoapClient("http://api.google.com/GoogleSearch.wsdl",$soapoptions);
print"<pre>";
$params = array(
'key' => $key, // the Developer's key
'q' => $query, // the search query
'start' => 0, // the point in the search results should Google start
'maxResults' => 10, // the number of search results (max 10)
'filter' => false, // should the results be filtered?
'restrict' => 'countryCN',
'safeSearch' => false,
'lr' => 'lang_zh-CN',
'ie' => '',
'oe' => ''
);
$response=$soap_client->__soapCall("doGoogleSearch",$params);
//echo $soap_client->__getLastRequest()."\n";
//echo $soap_client->__getLastResponse()."\n";
//var_dump($response);
for($i=0;$i<$num;$i++)
{
$res[] = $soap_client->__soapCall("doGoogleSearch",$params);
$i++;
}
print_r($res);
//$soap_client->doGoogleSearch();
//var_dump($soap_client->__getTypes());
复制代码
作者:
轩辕砍刀
时间:
2007-04-28 17:47
多谢,学习了!
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2