php – NuSOAP和内容类型

前端之家收集整理的这篇文章主要介绍了php – NuSOAP和内容类型前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
无法弄清楚如何使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);
    }
}

这是请求:

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

我甚至进入了nusoap.PHP并更改了几行ISO硬编码的行.我错过了什么?

尝试:
$soapClient->soap_defencoding = 'UTF-8';
$soapClient->decode_utf8 = false;

还要确保你发送utf8编码数据,否则它有点矛盾. (函数utf8_encode()).

原文链接:https://www.f2er.com/php/134838.html

猜你在找的PHP相关文章