Hello
I had problems with the error "
XML error parsing SOAP payload on line 1: Mismatched tag".
After analyzing with Debug () I discovered that the SOAP Response message was truncated in 3 characters, leaving the string "ENV: Envelo" at the end and the characters "pe>" being lost.
The error occurred when the BODY had a length greater than 8192 characters.
A basic but effective solution:
According to what I researched and tested, when the SOAP Response BODY is greater than 8192 characters, the "Content-Length:" value returned in the Response header (incoming_headers ['content-length']) is wrong, it is 3 bytes shorter, so when function getResponse () excecute the fread () function, the variable $ data is truncated at end, Leaving always the string "
ENV: Envelo".
What the patch does is correct, on client side, the length.
The revision of the code should be continued to see, at server side, to know what is wrong in calculating the length.
Original Code (Line 3054 in
nusoap.php version = '0.9.5'
function getResponse(){
....
while (($strlen < $content_length) && (!feof($this->fp))) {
$readlen = min(8192, $content_length - $strlen);
$tmp = fread($this->fp, $readlen);
|
Patched code:
function getResponse(){
....
while (($strlen < $content_length) && (!feof($this->fp))) {
$readlen = min(8192, $content_length - $strlen);
// add 01/06/2017 claudiocepeda@hotmail.com -------------------------
if ($readlen < 8192) {$readlen = $readlen + 3;}
// -----------------------------------------------------------------------------
$tmp = fread($this->fp, $readlen);
|
![Very Happy](images/smiles/icon_biggrin.gif)