webservice中有中文的话,返回的值就变成了乱码.查看了一下response的结果,是正确的.应该是用nusoap处理的时候出现了问题.
更改了nusoap.php两个地方就OK了.
更改的地方:
86行的:var $soap_defencoding = 'UTF-8';
4998行的:var $decode_utf8 = false;
不更改也可以,不过在调用的时候就必须指定编码.
1.服务器端接口
$server=new soap_server(); //生成对象$server->soap_defencoding = 'utf-8';$server->decode_utf8 = false;
2.调用用接口
$client = new soapclient('http://localhost/TestService/Service1.asmx?WSDL', true);
$client->soap_defencoding = 'UTF-8';$client->decode_utf8 = false;
附件:
nusoap源文件: http://www.cnblogs.com/Files/coolstr/nusoap.zip
各种编码转换源文件: http://www.cnblogs.com/Files/coolstr/chinese.zip
参考文档:
http://blog.csdn.net/haiqiao_2010/article/details/8813126
http://www.zuimoban.com/php/php/4463.html
http://blog.csdn.net/shrimpma/article/details/5986530
转载于:https://www.cnblogs.com/liruning/p/6769289.html
相关资源:数据结构—成绩单生成器