s_seraph
(s_seraph)
高级会员

资深会员
UID 27331
精华
0
积分 705
帖子 705
金钱 705 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2004-3-28 来自 深圳
状态 离线
|
一个VB+PHP+Nusoap的乱码问题
问题表现:我用nusoap写了一个soap的应用服务端,但是在用VB.NET做为客户端调用这个远程应用服务里定义的方法的时候,返回到VB的中文字符串变成了乱码。不知道问题在哪里。
分析:
一、我用PHP写的soap客户端来调用应用服务,一切正常。
二、VB调用的时候不管是传入方法的参数里有中文还是在应用服务的方法里本身有输出中文字符,其在VB里返回的都是乱码。
三、nusoap的默认编码是ISO-8859-1,好象是德文-_-,如果我将其改为UTF-8或??????,VB端一样乱码,而PHP端则输出为空,分析返回的XML后发现是出错了。如果把nusoap内所有的ISO-8859-1都换成??????,同样出错,出错意思大概是没有合适的??????编码转换。。。
四,VB.NET里也有分别换成UTF-8、??????来试,都不行。
五、一个发现,VB里的urlencode的返回与PHP的urlencode的返回居然完全不同。。。晕。。。
nusoap内的编码改为??????后response的xml:
HTTP/1.1 500 Internal Server Error
Date: Thu, 09 Sep 2004 04:15:03 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4
X-Powered-By: PHP/4.3.4
Set-Cookie: PHPSESSID=b35fd0ac5381c048a5dc1a602fd66605; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Accelerated-By: PHPA/1.3.3r2
Status: 500 Internal Server Error
X-SOAP-Server: NuSOAP/0.6.6 (1.70)
Content-Length: 709
Connection: close
Content-Type: text/xml; charset=??????
<?xml version="1.0" encoding="??????"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Server</faultcode><faultactor></faultactor><faultstring>error in msg parsing:
XML error parsing SOAP payload on line 1: not well-formed (invalid token)</faultstring><detail><soapVal xsi:type="xsd:string"></soapVal></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
|