webclient.php文件:
<?php
$arrOptions = array( 'uri'=>'http://10.10.19.111/','location'=>'http://10.10.19.111/webservice/webservice.php','trace'=>true,'exceptions'=>0 );
$objSoapClient = new SoapClient( null,$arrOptions );
try
{
$strReturn = $objSoapClient->returnString();
}
catch( Exception $e )
{
echo $e->getMessage();
}
echo "strReturn=";
echo $strReturn;
?>webservice.php文件:
<?php
require_once( "Basic.php" );
$arrOptions = array( 'uri'=>'http://10.10.19.111/' );
$objSoapServer = new SoapServer( null,$arrOptions );
$objSoapServer->setClass("Basic");
$objSoapServer->handle();
?>Basic.php文件:
<?php
class Basic
{
public function returnString()
{
return "Hello World !!!";
}
}
?>浏览器浏览webclient.php文件结果:
strReturn=Object id #2这个例子是照着网上的例子做的,别人实践成功了,在我的上面就是不行