phpxmlrpc
phpxmlrpc copied to clipboard
Problem with inflated
For a request working fine in my coworkers pc, I'm getting Invalid return payload: enable debugging to examine incoming payload (XML error at line 1, check URL). Debug returns an INFLATED RESPONSE that i'm not able to get acces to, but it seems correct. but also I'm getting this:
---GOT---
HTTP/1.1 200 OK
Date: Thu, 07 Feb 2019 08:09:13 GMT
Server: Apache/2.4.18 (Ubuntu)
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 957
Connection: close
Content-Type: text/xml;charset=none
â¹ÃÂkoÃ0â ¿÷WDý´JÃb;@è¢@i´*©¸üâ¬,¸m$â0'¶?séE¹-£â¦ÅO`^|°ý>ãÃÃå¯x¡<qâEiòÃâ~%§âý+æùC:ólâ¢&âÃ@qöüD>>â¹G÷!âò8òà µ6ÃÃ
c˯uâ\ôÂ$ËyÿŽâ¡Â¥®Ÿ¿¼4Jò>#âÂâº*YêæÃâ°Â¥nÃþNGð;.xFâ°ÃÃÂâû>a¬Ã3tBtKÃVUЦbÃâ½1té¯Ã
óèç#Ãâ¹âºG6Å âÃÂ/+ãÃâyâ(5Iâ¡âhâ¬ËÃôzD'â
ºRM>0bÅ¡DÃÃ
F¢$nFÂâââ°mÃ
ºR
---END---
HEADER: date: Thu, 07 Feb 2019 08:09:13 GMT
HEADER: server: Apache/2.4.18 (Ubuntu)
HEADER: vary: Accept-Encoding
HEADER: content-encoding: gzip
HEADER: content-length: 957
HEADER: connection: close
HEADER: content-type: text/xml;charset=none
Hello.
I fear that charset=none might confuse the client-side of the lib.
However, that would most likely give a different error...
One easy way to troubleshoot the problem is to enable/disable support for receiving compressed responses, via setting the corresponding flag in the client
Doing $client->setAcceptedCompression("");i'm not getting the baddly codified string, but i'm still getting the same error...
What trubbles me is taht i can see that im getting the responses but i dont know how to get it.
--GOT---
HTTP/1.1 200 OK
Date: Thu, 07 Feb 2019 11:09:01 GMT
Server: Apache/2.4.18 (Ubuntu)
Vary: Accept-Charset,Accept-Encoding
Content-Length: 174337
Connection: close
Content-Type: text/xml;charset=none
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><array>
<data>
<value><struct>
<member>
...
</member>
...
$res->faultCode() is true.
This seems indeed to be a charset encoding problem then. Do you have a way to send me the response payload, in its binary form? Or could I access the server to examine the responses?
Unfortunatyl I couldn't, since is protected information... How can i acces de binary form of the response payload?
(thanks for your help, btw)
I thing the problem is here:
I hitnk the problem might be here(xmlrpc.inc line 2630):
if (extension_loaded('mbstring')) {
$data = mb_convert_encoding($data, 'UTF-8', $resp_encoding);
}
After that call to mb_convert_encoding, $data is not longer accesible.($resp_encodig is "NONE", ata that point).
EDIT: HOTFIX so i can keep working:
$data = mb_convert_encoding($data, 'UTF-8', 'gzip');
gzip is not a valid value for mb_convert_encoding. Can you test instead if using 'auto' works? If so, I could think about adding some special-case code for when invalid charset declarations are found, such as in your case.
Tbh, I think that you should rather fix the server so that it does not emit the charset encoding header at all instead of saying charset=none ...
No feedback for over two years. Closing