SOAP-ERROR: Encoding: string ... is not a valid utf-8 string

What about change the encoding settings:

SERVER:

$server = new SoapServer("some.wsdl", array('encoding'=>'ISO-8859-1')); // for 'windows-1252' too

CLIENT:

$server = new SoapClient("some.wsdl", array('encoding'=>'ISO-8859-1')); // for 'windows-1252' too

... then the conversion is done automatically to UTF-8, I had the similiar problem, so this helped me, so it is tested


Today I run into same problem - the code which caused that problem was:

$request->Text = substr($text, 0, 40);

changing substr to mb_substr seems to solve the issue:

$request->Test = mb_substr($text, 0, 40, 'utf8');

The problem is that í != i. Try to convert your string to UTF-8 before using in a request. It may look like that:

$string = iconv('windows-1252', 'UTF-8', $string);

See http://php.net/iconv