码迷,mamicode.com
首页 > Web开发 > 详细

使用别人webService简介

时间:2014-11-23 21:47:58      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   使用   sp   for   

什么是webservice?

简单见就是你的网站可以使用其他网站的资源。

bubuko.com,布布扣



使用:

 修改php配置文件 打开extension=php_soap.dll

bubuko.com,布布扣



下面是一个具体使用:

http://webservice.webxml.com.cn/webservices/mobilecodews.asmx?wsdl

bubuko.com,布布扣

使用代码:

<?php
//利用soapclient 来请求webservice服务器
//通过wsdl,即可了解webservice可调用的方法和细节 WSDL 说明书
$soapclient =  new soapClient("http://webservice.webxml.com.cn/webservices/mobilecodews.asmx?wsdl");


/*
print_r($soapclient -> __getFunctions()); //分析webservice有哪些方法可以调用
运行结果
Array
(
    [0] => getMobileCodeInfoResponse getMobileCodeInfo(getMobileCodeInfo $parameters)
    [1] => getDatabaseInfoResponse getDatabaseInfo(getDatabaseInfo $parameters)
    [2] => getMobileCodeInfoResponse getMobileCodeInfo(getMobileCodeInfo $parameters)
    [3] => getDatabaseInfoResponse getDatabaseInfo(getDatabaseInfo $parameters)
)

*/

/*
	print_r( $soapclient -> getMobileCodeInfo(array('mobileCode'=>18790529086)));
	运行结果:
	stdClass Object ( [getMobileCodeInfoResult] => 18790529086:河南 新乡 河南移动全球通卡 )
*/


使用别人webService简介

标签:style   blog   http   io   ar   color   使用   sp   for   

原文地址:http://blog.csdn.net/buyingfei8888/article/details/41413187

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!