Home  >  Article  >  php教程  >  soap远程服务

soap远程服务

WBOY
WBOYOriginal
2016-06-06 19:38:181011browse

无详细内容 无 ?phptry{$soapcfg=array("location"="http://localhost/OOP/SOAP/backSoap1.php","uri"="phpjs");$soap=new SoapClient(NULL,$soapcfg);echo $soap-toAlert('Notice!');echo $soap-toOpen('http://www.baidu.com','_blank');}catch(Exception $

<?php
try{
	$soapcfg=array(
	"location"=>"http://localhost/OOP/SOAP/backSoap1.php",
	"uri"=>"phpjs"
	);
	
	$soap=new SoapClient(NULL,$soapcfg);
	
	echo $soap->toAlert('Notice!');
	echo $soap->toOpen('http://www.baidu.com','_blank');
	
}catch(Exception $e){
	echo $e->getMessage();
}
?>
<?php
class PHPjs{
	
	function toAlert($str){
		return "<script language='javascript'>
		       alert('$str');
			   </script>";
	}
	
	function toOpen($url,$style){
	return "<script language='javascript'>
	        window.open('$url','$style');
			</script>";
	}
}

$soap=new SoapServer(NULL,array('uri'=>'phpjs'));
$soap->setClass('PHPjs');
$soap->handle();
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn