加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

使用别人webService简介

发布时间:2020-12-16 23:12:27 所属栏目:安全 来源:网络整理
导读:什么是webservice? 简单见就是 你的网站可以使用其他网站的资源。 使用: ?修改php配置文件 打开extension=php_soap.dll 下面是一个具体使用: http://webservice.webxml.com.cn/webservices/mobilecodews.asmx?wsdl 使用代码: ?php//利用soapclient 来请

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读