Php WSDL SOAP-ERROR:编码:字符串';Li\xe8…';不是有效的utf-8字符串

Php WSDL SOAP-ERROR:编码:字符串';Li\xe8…';不是有效的utf-8字符串,php,xml,soap,utf-8,wsdl,Php,Xml,Soap,Utf 8,Wsdl,我已经在收到此错误的客户端上创建了一个WSDL Web服务 Array ( [faultcode] => SOAP-ENV:Server [faultstring] => SOAP-ERROR: Encoding: string 'Luik / Li\xe8...' is not a valid utf-8 string ) 试图添加$server->setEncoding('UTF-8')但它给出了api调用错误,下面是我的服务器脚本 ini_set("soap.wsdl_cac

我已经在收到此错误的客户端上创建了一个WSDL Web服务

Array ( [faultcode] => SOAP-ENV:Server [faultstring] => SOAP-ERROR: Encoding: string 'Luik / Li\xe8...' is not a valid utf-8 string )
试图添加
$server->setEncoding('UTF-8')但它给出了api调用错误,下面是我的服务器脚本

ini_set("soap.wsdl_cache_enabled", "0"); 
$server = new SoapServer('hello.wsdl', array('uri' => 'http://schemas.xmlsoap.org/wsdl/','classmap' => 'helloclass') );
$server->setClass('hello');
$server->handle();

function getDIDArea()
{
   $ret_final = new soapVar($ErrorMessage, SOAP_ENC_ARRAY,NULL, "urn:helloWSDL");
   return $ret_final;
}
hello.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<definitions 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:tns="urn:helloWSDL" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:helloWSDL">

它总是返回相同的错误。这是服务器
Luik/Liège

返回的结果,您的
$parameters
不是utf-8。在调用点进行修复。
$parameters=array(utf8_encode(“****”),utf8_encode(“****”),utf8_encode('32'),utf8_encode('1'),utf8_encode('9'),utf8_encode(''),utf8_encode(''),utf8_encode(''),utf8_encode('21')
这些是我的$parameters,但结果仍然相同。
utf8\u encode()
不是魔术。。。你的输入字符集是什么?我的输入字符集是
UTF-8
你的php文件的编码类型是什么?是UTF-8还是另一个?
require_once "nusoap.php";
$soapclient= new soapclient('http://localhost/WebGetServer.wsdl', true);
$SoapResult = $soapclient->call("hello", $parameters,'urn:hello');
print_r($SoapResult);