php动态调用webservicee,会者请速进。

后使用快捷导航没有帐号?
工作时间:周一至周五(08:30~18:00)
官方微信二维码温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
2.掉用页面&?phpheader('Content-Type: text/ charset=UTF-8');$client = new SoapClient('.cn/WebServices/MobileCodeWS.asmx?WSDL');$parm=array('mobileCode'=&'','userID'=&'');$result=$client-&getMobileCodeInfo($parm);$result=get_object_vars($result); & //将stdclass object转换为array,这个比较重要了echo "你的手机卡信息:".$result['getMobileCodeInfoResult'];?&就这么简单了。。
阅读(16563)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'php利用SoapClient调用webservices',
blogAbstract:'1.开启soap支持,在php.ini中去除extension=php_soap.dll之前的‘;’2.掉用页面&?phpheader(\'Content-Type: text/ charset=UTF-8\');$client = new SoapClient(\'.cn/WebServices/MobileCodeWS.asmx?WSDL\');$parm=array(\'mobileCode\'=&\'\',\'userID\'=&\'\');$result=$client-&getMobileCodeInfo($parm);',
blogTag:'soap,webservices',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:9,
publishTime:5,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:1,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:true,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}正在播放:php调用webservice
下载学院APP缓存视频离线看
购买本课程后即可享受以下服务:
24小时讲师答疑
所有课时永久观看
专属课件资料下载
购买课程返学分
购买本课程后,就可以记笔记了~~
开始记笔记……
记录时间点
我的笔记同学的笔记
购买本课程后,就可以提问题了~~
向老师提问……
记录时间点
我的问题同学的问题17340人阅读
1.WSDL模式:
$soap = new SoapClient(&http://192.168.6.69:8899/Service1.asmx?wsdl&);
$result2 = $soap-&HelloWorld(array(
'myName'=&'aaa',
'youName'=&'bbb'
print_r($result2);
2.non-WSDL模式:
2.1使用SoapParam传递参数:
$soap = new SoapClient(null,array('location'=&'http://192.168.6.72:8036/Service1.asmx','uri'=&'http://tempuri.org/'));
$result2 = $soap-&__soapCall(&HelloWorld&,
array(new SoapParam(&aaa&, &myName&),new SoapParam(&bbb&, &youName&)),
//array(new SoapParam(&aaa&, &ns1:myName&),new SoapParam(&bbb&, &ns1:youName&)),
array('soapaction'=&'http://tempuri.org/HelloWorld'));
print_r($result2);
2.2使用SoapVar传递参数
$ns = 'http://tempuri.org/';
$soap = new SoapClient(null,array('location'=&'http://192.168.6.72:8036/Service1.asmx','uri'=&$ns));
$result2 = $soap-&__soapCall(&HelloWorld&,
array(new SoapVar(&AAA&, XSD_STRING, null, $ns, &myName&, $ns),
new SoapVar(&GBBB&, XSD_STRING, null, $ns, &youName&, $ns)),
array('soapaction'=&'http://tempuri.org/HelloWorld'));
print_r($result2);
3.添加安全Header
$soap = new SoapClient(null,array('location'=&'http://192.168.6.47/onvif/device_service','uri'=&'http://www.onvif.org/ver10/device/wsdl/'));
$ns_wsse = &http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&;//WS-Security namespace
$ns_wsu = &http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&;//WS-Security namespace
$userT = new SoapVar('admin', XSD_STRING, NULL, $ns_wsse, NULL, $ns_wsse);
$passwT = new SoapVar('NnYZe7oD81Kd8QRS4tUMze/2CUs=', XSD_STRING, NULL, $ns_wsse, NULL, $ns_wsse);
$createdT = new SoapVar(time(), XSD_DATETIME, NULL, $ns_wsu, NULL, $ns_wsu);
class UsernameT1 {
private $U
//Name must be
identical to corresponding XML tag in SOAP header
private $P
// Name must be
identical to corresponding XML tag in SOAP header
private $C
function __construct($username, $password, $created) {
$this-&Username=$
$this-&Password=$
$this-&Created=$
$tmp = new UsernameT1($userT, $passwT, $createdT);
$uuT = new SoapVar($tmp, SOAP_ENC_OBJECT, NULL,
$ns_wsse, 'UsernameToken', $ns_wsse);
class UserNameT2 {
private $UsernameT
//Name must be
identical to corresponding XML tag in SOAP header
function __construct ($innerVal){
$this-&UsernameToken = $innerV
$tmp = new UsernameT2($uuT);
$userToken = new SoapVar($tmp, SOAP_ENC_OBJECT, NULL, $ns_wsse, 'UsernameToken', $ns_wsse);
$secHeaderValue=new SoapVar($userToken, SOAP_ENC_OBJECT, NULL,
$ns_wsse, 'Security', $ns_wsse);
$secHeader = new SoapHeader($ns_wsse, 'Security', $secHeaderValue);
$result2 = $soap-&__soapCall(&GetDeviceInformation&,array(),null,$secHeader);
echo $result2;
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:39867次
排名:千里之外
转载:18篇
(1)(1)(4)(1)(1)(1)(1)(2)(1)(1)(3)(1)(5)(4)

我要回帖

更多关于 动态调用webservice 的文章

 

随机推荐