SOAP-ERROR: Encoding: string … is not a valid utf-8 string

PHP 利用SOAP调用webservice 传输汉字数据时,开发环境使用GBK模式,报上述错误,解决方法,在配置中使用如下语句:

$server = new SoapServer(null, array(
    'uri' =>'http://soap/',
    'encoding'=>'ISO-8859-1'
    //'location'=>'http://61.160.96.114:8000/inc/service/serverSoap.php'   
));

            $soap = new SoapClient(null, array(
                'location'=>'http://61.160.96.114:8000/inc/service/serverSoap.php',
                'uri' =>'http://soap/',
                'encoding'=>'ISO-8859-1'
            ));

 

posted on 2016-08-01 11:30  xihong  阅读(1140)  评论(0编辑  收藏  举报

导航