header('Content-Type: text/html; charset=UTF-8');
//链接
$http='http://xxxxxx?wsdl';
//参数,很重要,之前搞的时候一直传不了参数过去,原来是这样的,搞死我了
$params=array('string'=>'xxx','string1'=>'xxxx');
$client = new SoapClient($http,array('encoding'=>'utf-8','cache_wsdl' => 0,'compression'=>true));
$client->soap_defencoding = 'utf-8';
$client->xml_encoding = 'utf-8';
//请求返回的数据
$return = $client->$fun($params);//parameters
http://www.phpjungle.com/index.php/php/40-php-soap-web-service
看看这个有无帮助 :)
--------------------------------
另外如果真的需要传递对象作为方法的参数,可以变通实现的:
比如:在客户端将对象序列化,然后在服务端方法中将其反序列化,这是一个思路,不妨一试 :)