|
uprmi如何让php支持soap和socket如果不想编译的话
因为我如下操作不成功
我下载相应的到当前上一级的soap目录里
soapfunc.php
<?
require_once('./soap/nusoap.php');
function reverse($str)
{
$retval="";
if(strlen($str)<1)
{
return new soap_fault('Client','',''Invalid string');
}
for($i=1;$i<=strlen($str);$i++)
{
$retval .=$str[(strlen($str)-$i)];
}
return $retval;
}
?>
soapserver.php
<?
require_once('./soap/nusoap.php');
include('soapfunc.php');
$soap=new soap_server;
$soap->register('reverse');
$soap->service($HTTP_RAW_POST_DATA);
?>
soapclient.php
<?
include('./soap/nusoap.php');
$client=new soapclient('http://192.168.1.1/peter/php/petergpg/phpfile/soapserver.php');
$str="this string will be reversed";
#$params1=array('str'=>$str);
#$reversed=$client->call('reverse',$params1);
$reversed=$client->call('reverse',$str);
echo "if you reverse '$str',you get '$reversed' <br>\n";
?>
访问soapclient.php结果是
if you reverse 'this string will be reversed',you get ''
其我要的结果没有显示出来啊 |
|