使用别人webService简介

来源:互联网 发布:聚翔网络 编辑:程序博客网 时间:2024/05/01 12:14

什么是webservice?

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




使用:

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




下面是一个具体使用:

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


使用代码:

<?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:河南 新乡 河南移动全球通卡 )*/


0 0
原创粉丝点击