Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cURL response not readable

Tags:

php

curl

I have a problem with my cURL response, when I try to invoke the method of WSDL, I receive this weird text from my browser,

�d�ْ�<�_��[�7�4eS�@���8 �]��Q��A���>�t�,����]�1��%Y���4!l�^ZG��,8��v��������#ZJ�W��
r)0Ek����Q�����"Ᏹ�!�0��0����(�T�$���� Z��փ��UU���g������&�C�f
8�!��5��L�t{����6�?{jY�Q��?���K����3�D2�e   �߱Oc����@^P��$�IΠ�4A[;�p�\7�����i5��+�\歖~=����)�����a�L�GJey�F����Ɍ��v]��<��z������N����\z��.�i:�S5��FgkM�hS���|,\�0�E9i=�+ӄ�!^WҶ�7�����0�w���+b�۹��[�;���fE4_ڑ�������u�Q)E��;�;�JL���������Ԩ�1��7[�$D���\�W���ۂU$9���

How can I solve this?

Here's my header

$headers = array(
                "Accept-Encoding: gzip, deflate",
                "Content-Type: text/xml;charset=\"UTF-8\"",
                "SOAPAction: \"http://tempuri.org/"",
                "Host: domain.com",
                "Content-length: ".strlen($xml_post_string),
                "Connection: Keep-Alive"
                ); 

and here's my curl options

curl_setopt($soap_do, CURLOPT_URL,            $url);
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($soap_do, CURLOPT_TIMEOUT,        120);
curl_setopt($soap_do, CURLOPT_AUTOREFERER,    true); // new
curl_setopt($soap_do, CURLOPT_MAXREDIRS,      10);   // new
curl_setopt($soap_do, CURLOPT_FOLLOWLOCATION, true); // new
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST,           true );            
curl_setopt($soap_do, CURLOPT_POSTFIELDS,     $xml_post_string); 
curl_setopt($soap_do, CURLOPT_VERBOSE,        TRUE); 
curl_setopt($soap_do, CURLOPT_HTTPHEADER,     $headers);
like image 925
PHP Avatar asked Jun 06 '15 01:06

PHP


1 Answers

Thank you guys for your comment, I have solve the issue now, shout out to Grokify, I just remove the Accept-Encoding: gzip, deflate and it is now readable.

like image 167
PHP Avatar answered Oct 27 '22 20:10

PHP