无法弄清楚如何使NuSOAP使用UTF-8作为内容类型.它不断吐出"ISO-8859-1".这是我尝试的相关代码位:
$soapclient=new soapclient($url1,'wsdl');
$soapclient->http_encoding='utf-8';
$soapclient->defencoding='utf-8';
if($soapclient->fault){
$retdata=$soapclient->fault;
}else{
if($soapclient->getError()){
$retdata=$soapclient->getError();
}else{
$params=array($xmldata);
$retdata=$soapclient->call($doit,$params,$url1,$url2);
}
}
Run Code Online (Sandbox Code Playgroud)
这是请求:
POST xxxxxxxxxxxx HTTP/1.0
Host: xxxxxxxxxxxxx
User-Agent: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: "xxxxxxxxxxxxxxxxx"
Content-Length: 1629
Run Code Online (Sandbox Code Playgroud)
我甚至进入了nusoap.php并更改了几行ISO硬编码的行.我错过了什么?
vic*_*LLA 11
尝试:
$soapClient->soap_defencoding = 'UTF-8';
$soapClient->decode_utf8 = false;
Run Code Online (Sandbox Code Playgroud)
还要确保你发送utf8编码数据,否则有点矛盾.(函数utf8_encode()).
| 归档时间: |
|
| 查看次数: |
23022 次 |
| 最近记录: |