Blogger Information
Blog 10
fans 1
comment 0
visits 12496
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkphp使用SoapClient调用JAVA接口实例
GrMax的博客
Original
2127 people have browsed it

废话不说还是一如既往的直接上代码!

基于THINKPHP调用SoapClient对象与JAVA接***互  

用TP基础的人应该问题不大  可能写得不是特别好!但是基本思路是这样的

public function findCustomerInfo(){
	$tel=I('tel',int);
	$name=I('name','htmlspecialchars');
	$url="https://127.0.0.1:8080/findsalesrecordcustomer/services/Login.jws?wsdl";
	$soap = new SoapClient($url);  
	$result2 = $soap->findCustomerInfo($tel,$name);  	//调用JAVA暴露的方法并传值
	$data=json_decode($result2,true);
	if (empty($name)|| empty($tel)) {
		$this->error($data['msg']);
		}
		if ($data['obj'][0]['username']=='') {
			$error="没有查询到信息,请查证后再在重新输入";
			$this->error($error);
		}
		$bxtiom=$data['obj'][0]['salesdatetime'];
		$bxtiom=date("Y-m-d",strtotime("$bxtiom   +10   year")); 
		$data['obj'][0]['phone']=$tel;	
		$this->data=$data;
		$this->bxtiom=$bxtiom;
		$this->display('select');
	}
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post