How to get JSON response from SOAP Call in PHP
问题 As SOAP client returns XML response by default, I need to get JSON response in return instead of XML. $client = new SoapClient(null, array('location' => "http://localhost/soap.php", 'uri' => "http://test-uri/")); In that case what attribute needs to be set in SOAPClient or SOAPHeader so that it returns JSON response? 回答1: From what I have been able to find out from some research, the SoapClient does not have any built in way to return the data directly as JSON (anyone else know if I'm wrong,