$client = new SoapClient(null,array('location' =>"http://999.com/sxt/admin/sys/functions.php",'uri'=> "http://88.com/"));
function convert_points($xcoords, $ycoords, $getDistances = false) 
{
  return $client->convert_points($xcoords, $ycoords, $getDistances);
}
//===============================================================================================  
function convert_points($xcoords, $ycoords, $getDistances = false) 
{
 $client = new SoapClient(null,array('location' =>"http://999.com/sxt/admin/sys/functions.php",'uri'=> "http://88.com/"));
  return $client->convert_points($xcoords, $ycoords, $getDistances);
}为什么这两种办法都是错的呢?如里大可以指教一下,把SOAP写到函数里?,
我也可以支付一些酬劳
QQ:251414041

解决方案 »

  1.   

    第一种写法肯定不对,你没搞懂局部变量,全局变量
    SoapClient,第一个参数好像是wsdl地址吧?
      

  2.   

    如果我不写的函数里这样直接调用是正确的
      $client = new SoapClient(null,
           array('location' =>"http://88.com/pprc/server.php",'uri'=> "http://88.com/")
       );
       
       
       
       
       
       echo $client->say1(2);
     echo $client->say("hello world");
    像这样是正确的
      

  3.   


    要么把你写在函数外的 $client做参数传给函数,要么在函数里声明全局变量!